Hello Ahmed!



 Ahmed_Abdelaziz:

Another idea that came to my mind is to sum both loss1 and loss2 (let’s call it loss3) and backpropagate. I have the initial idea that loss3 will only backpropagate loss2 until it reaches c and then backpropagated the weighted sum. Is that right?


Yes, this is, in effect, what will happen.
Summing the losses is the approach I would take.  I would probably
include relative weights: loss = w1 * loss1 + w2 * loss2.
Note, that loss1 does not depend on the weights in modules D and
E, so backpropagating loss1 + loss2 will have the same effect on
modules D and E as backpropagating loss2 alone.
But, as you correctly reason, both loss1 and loss2 will affect
modules A, B, and C when backpropagating loss1 + loss2.
Be aware though, that including loss1 could push push A, B, and
C away from where they would provide the best performance for
the output of your overall model (and lead to higher values of
loss2).
On the other hand, including loss1 could help prevent A, B, and
C from overfitting your training set, potentially providing better
performance on your test set.
Good luck.
K. Frank