Losses
Losses (contrib)
Loss operations for use in neural networks.
Note: By default all the losses are collected into the GraphKeys.LOSSES
collection.
All of the loss functions take a pair of predictions and ground truth labels, from which the loss is computed. It is assumed that the shape of both these tensors is of the form [batch_size, d1, ... dN] where batch_size
is the number of samples in the batch and d1
... dN
are the remaining dimensions.
It is common, when training with multiple loss functions, to adjust the relative strengths of individual losses. This is performed by rescaling the losses via a weight
parameter passed to the loss functions. For example, if we were training with both log_loss and sum_of_squares_loss, and we