public class L2Loss extends Loss
L2 loss is defined by \(L = \frac{1}{2} \sum_i \vert {label}_i - {prediction}_i \vert^2\)
totalInstances
Constructor and Description |
---|
L2Loss()
Calculate L2Loss between the label and prediction, a.k.a.
|
L2Loss(java.lang.String name)
Calculate L2Loss between the label and prediction, a.k.a.
|
L2Loss(java.lang.String name,
float weight)
Calculates L2Loss between the label and prediction, a.k.a.
|
Modifier and Type | Method and Description |
---|---|
NDArray |
evaluate(NDList label,
NDList prediction)
Calculates the evaluation between the labels and the predictions.
|
addAccumulator, getAccumulator, hingeLoss, hingeLoss, hingeLoss, l1Loss, l1Loss, l1Loss, l2Loss, l2Loss, l2Loss, resetAccumulator, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, sigmoidBinaryCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, softmaxCrossEntropyLoss, updateAccumulator
checkLabelShapes, checkLabelShapes, getName
public L2Loss()
public L2Loss(java.lang.String name)
name
- the name of the losspublic L2Loss(java.lang.String name, float weight)
name
- the name of the lossweight
- the weight to apply on loss value, default 1/2