(I am sorry if my English is not good)
I can create my own loss function in PyTorch if the function requires only DNN output vector(predicted) and DNN output vector(ground truth).
I want to use additional variables to calculate the loss.
I make my training and test data like below;
DNN input:
Data_A-> processing 1 ->Data_X
DNN output:
Data_A-> processing 1 ->Data_XData_B-> processing 1 ->Data_PData_X,Data_P-> processing 2 ->Data_Y
and I divide Data_X and Data_Y into train data and test data.
x_train, x_test, y_train, y_test = train_test_split(Data_X,Data_Y,test_size=0.2, random_state=0)
I want to use Data_A, Data_B, Data_Y(predicted), and Data_Y(ground truth) to calculate the loss.
I saw many examples for customized loss function which only use Data_Y(predicted) and Data_Y(ground truth). I could use such a customized loss function before.
However, I don't know what to do when I want to use another additional variables.
Is there a good way? Thank you for your help!