Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keras: How is the loss evaluated during optimization for a network with multiple output layers?

Tags:

keras

loss

I am using functional API in Keras to build a neural network model with multiple output layers. I was wondering how the loss is evaluated when updating the weights during optimization (When doing back-prop). Assuming that the same loss function is used, is then the average loss of all outputs used to minimize the cost function or is each output evaluated separately to update the weights?

Thanks in advance!

like image 224
U.C Avatar asked Dec 04 '25 09:12

U.C


1 Answers

There is always only one loss that is used to backpropagate the errors, when a model has multiple outputs, then each output is associated one loss, and then a "global" loss is constructed by weighting the loss for each output. You can set the weight for each loss when you compile the model.

like image 171
Dr. Snoopy Avatar answered Dec 07 '25 18:12

Dr. Snoopy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!