- class brainpy.losses.l2_loss(predicts, targets)#
Computes the L2 loss.
The 0.5 term is standard in “Pattern Recognition and Machine Learning” by Bishop , but not “The Elements of Statistical Learning” by Tibshirani.
predicts (ArrayType) – A vector of arbitrary shape.
targets (ArrayType) – A vector of shape compatible with predictions.
loss – A scalar value containing the l2 loss.
- Return type: