You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reduction (str, optional) – Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. 'none': no reduction will be applied, 'mean': the sum of the output will be divided by the number of elements in the output, 'sum': the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of those two args will override reduction. Default: 'mean'
We used default: 'mean', so the output is a scalar value, this results in loss.shape being torch.Size([])
If we want the loss for each element, we should use reduction='none', which results in loss.shape being the same as input and target.
No description provided.
The text was updated successfully, but these errors were encountered: