How to Combine Multiple Losses ?

276 views
Skip to first unread message

par...@unlv.nevada.edu

unread,
Jul 24, 2016, 5:53:13 PM7/24/16
to Caffe Users

 I am calculating 3 unique losses, let's say loss_1, loss_2 and loss_3. Also, I mention the loss_weights, A,B and C.
 And the final loss is a linear combination of these losses as follows: Final_loss = A*loss_1 + B*loss_2 + C*loss_3.
 
 So, do I need to explicitly combine all the losses (using some kind of additive layer) or does the Caffe automatically
 compute the final loss as a weighted sum of all the losses using loss_weights ?

Thank you!

Ahmed Ibrahim

unread,
Jul 26, 2016, 3:56:55 PM7/26/16
to Caffe Users
Caffe automatically sum up the losses using the loss_weight

anand

unread,
Jun 22, 2017, 5:16:02 AM6/22/17
to Caffe Users
Hello,
I am also trying to do the same but I just wanted to confirm again.

In my case I want to use weighted linear combination of two losses of classes 
eg: loss1 = 0.8* SigmoidCrossEntropyLoss  and loss2 = 0.2*Softmaxwithloss and I would like to optimise both loss together
Net_Loss = loss1 + loss2

So as you said before, if I just give weights for each loss, caffe will automatically does the need full for different types of loss too ??

thank you
Reply all
Reply to author
Forward
0 new messages