in keras, I want to set up a loss function that not only accepts (y_true, y_pred) as input, but also needs to use output from the internal network layer as a label for the output level. The figure shows the network layout
Here, the internal output is xn, which is a 1D sign. in the upper right corner is the output xn ', which is the prediction of xn. In other words, xn is the label for xn '.
Although [Ax, Ay] is traditionally called y_true, and [Ax ', Ay'] is y_pred.
I want to combine these two loss components into one and jointly organize a network.
Any ideas or thoughts are greatly appreciated!
source share