brainpy.losses.l2_loss
brainpy.losses.l2_loss#
- brainpy.losses.l2_loss(predicts, targets)[source]#
Computes the L2 loss.
The 0.5 term is standard in “Pattern Recognition and Machine Learning” by Bishop 1, but not “The Elements of Statistical Learning” by Tibshirani.
- Parameters
- Returns
loss – A scalar value containing the l2 loss.
- Return type
References
- 1
Bishop, Christopher M. 2006. Pattern Recognition and Machine Learning.