How to use part of inputs for training but rest for loss function in Keras
问题 I am new to Keras and trying to implement a neural network machine learning model. The input tensor looks like (X1, X2) and outputs (Y). Note X1 and X2 are correlated. In the model, only X1 will be used for training, but both X1 and X2 will be passed to the loss function that is a function of X1, X2, y_pred and y_true. Below is a pseudocode for loss function. def customLossFunctionWrapper(input_tensor): def LossFunction(y_pred, y_true): loss_value = f(X1, X2, y_pred, y_true) return loss_value