Skip to content

[source]

Least Squares#

Least Squares (or quadratic loss) is a function that computes the average squared error (MSE) between the target output given by the labels and the actual output of the network. It produces a smooth bowl-shaped gradient that is highly-influenced by large errors.

LeastSquares=i=1D(yiy^i)2

Parameters#

This cost function does not have any parameters.

Example#

use Rubix\ML\NeuralNet\CostFunctions\LeastSquares;

$costFunction = new LeastSquares();

Last update: 2021-01-25