<p>That's a interesting problem. As @lvan said, this is a problem of optimization in a multi-objective.</p>
<p>The multi-loss/multi-task is as following:</p>
<pre><code>l(\theta) = f(\theta) + g(\theta)
</code></pre>
<p>The <code>l</code> is total_loss, <code>f</code> is the class loss function, <code>g</code> is the detection loss function.</p>
<p>The different loss function have the different refresh rate.As learning progresses, the rate at which the two loss functions decrease is quite inconsistent. Often one decreases very quickly and the other decreases super slowly.</p>
<p>There is a paper devoted to this question:</p>
<p><a href="https://arxiv.org/abs/1705.07115" rel="nofollow noreferrer">Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics</a></p>
<p>The main thinking of th paper estimate the uncertainty of each task, then automatically reducing the weight of the loss.</p>
<p>I am a non-native English speaker. Hope you can understand my answer and help you.</p>
optimizing multiple loss functions in pytorch
<p>I am training a model with different outputs in PyTorch, and I have four different losses for positions (in meter), rotations (in degree), and velocity, and a boolean value of 0 or 1 that the model has to predict.<br />
AFAIK, there are two ways to define a final loss function here:</p>
<p>one - the naive weighted sum of the losses</p>
<p>two - the defining coefficient for each loss to optimize the final loss.</p>
<p>So, My question is how is better to weigh these losses to obtain the final loss, correctly?</p>