Class ScaledMultiRationalLoss¶
Defined in File loss.h
Inheritance Relationships¶
Base Type¶
public marian::MultiRationalLoss
(Class MultiRationalLoss)
Class Documentation¶

class
ScaledMultiRationalLoss
: public marian::MultiRationalLoss¶ Scaled sum of losses.
This can weigh losses equally by choosing the first loss_0 as a reference and scaling all remaining losses loss_i by count_0 / count_i. Labels are summed up by the same rule. By this we simulate a sum of losses at similar scales. Dividing by scaled label counts yields a value close to an equally weighted sum of means.
L = sum_i^N L_i + N/M sum_j^M L_j
We set labels to N. When reporting L/N this is equivalent to sum of means. Compare to sum of means below where N is factored into the loss, but labels are set to 1.