-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"""Calculates the squared error for a set of predictions.
Mean Squared Error can be computed as squared_error(a, b).mean(). Note: l2_loss = 0.5 * squared_error, where the 0.5 term is standard in "Pattern Recognition and Machine Learning" by Bishop, but not "The Elements of Statistical Learning" by Tibshirani. References: [Chris Bishop, 2006](https://bit.ly/3eeP0ga) Args: predictions: a vector of arbitrary shape `[...]`. targets: a vector with shape broadcastable to that of `predictions`; if not provided then it is assumed to be a vector of zeros. Returns: elementwise squared differences, with same shape as `predictions`. PiperOrigin-RevId: 515627280
- Loading branch information
OptaxDev
committed
Mar 10, 2023
1 parent
5f0f5da
commit 451b006
Showing
4 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters