|View source on GitHub|
Computes the weighted loss.
Compat aliases for migration
See Migration guide for more details.
tf.losses.compute_weighted_loss( losses, weights=1.0, scope=None, loss_collection=tf.GraphKeys.LOSSES, reduction=Reduction.SUM_BY_NONZERO_WEIGHTS )
||the scope for the operations performed in computing the loss.|
||the loss will be added to these collections.|
||Type of reduction to apply to loss.|
When calculating the gradient of a weighted loss contributions from
weights are considered. If your
on some model parameters but you do not want this to affect the loss
gradient, you need to apply
passing them to
loss_collection argument is ignored when executing eagerly. Consider
holding on to the return value or collecting losses via a