Soft margin loss
Creates a criterion that optimizes a two-class classification logistic loss between input tensor x and target tensor y (containing 1 or -1).
nn_soft_margin_loss(reduction = "mean")
reduction |
(string, optional): Specifies the reduction to apply to the output:
|
\mbox{loss}(x, y) = ∑_i \frac{\log(1 + \exp(-y[i]*x[i]))}{\mbox{x.nelement}()}
Input: (*) where * means, any number of additional dimensions
Target: (*), same shape as the input
Output: scalar. If reduction
is 'none'
, then same shape as the input
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.