Closed alex-pardo closed 7 years ago
I see from the code that keras is performing a weighted sum over each loss, however, which are the weights? Losses are not simply added as you can see in the following image. class_out1 and class_out2 are the outputs of each part of the siamese and output2 is the combination of both (merge_mode='sum'), finally comp. loss is the value obtained when calling test_on_batch. Any clue on how this loss is computed?
Do you use the Graph api? If so the loss is the sum of your outputs' losses. Could you share a simplified version of your code so it will be easier to answer?
Also my problem
I'm using a siamese network with three different outputs. Two of them are the classification and the other is an additional label I use.
The question is, how the loss given in the callback is computed? I'm sure it is not the sum since I have computed it and does not match, but it is a bit messy to follow the logic in the code. The three outputs are using MAE as the optimizer.
Moreover, It would be nice to be able to monitor each of the loss values in the callback.