For some reason I need to use y_train (the target) in my model (not only in loss function), but I didn't find a way to get it.
I get my training dataset like this:
train_ds = DataGenerator("train", args).fetch()
<PrefetchDataset shapes: ((2, None), (2, 4000, 22)), types: (tf.float32, tf.float32)>
The second part (2,4000,22) is the target. Then I fit the model:
history = model.fit(train_ds, validation_data=valid_ds, callbacks=callbacks,
batch_size=args.batch_size, epochs=args.max_epoch)
I know how to get the target separately outside the model. But inside the model I don't know how. Is it possible?