Targets in custom loss and custom metric function in tf.Keras

  keras, python, tensorflow, tensorflow1.15

I am creating a tf.keras.model which is compiled with a custom loss and a custom metrics function. I call train_on_batch on model using x=input_batch and y=someFunction(targets)

The signature of custom loss and custom metrics functions looks like methodname(y_true,y_pred)
Here y_true is fed with someFunction(targets)

Is there any way to get targets in custom metrics function and custom loss function rather than the modified targets which are passed in train_on_batch

Source: Python Questions