#include <DF_MeanSquaredError.h>

Public Member Functions | |
| double | error (Model &model, const Array< double > &input, const Array< double > &target) |
| Calculates the mean squared error between the output and the target vector. | |
| double | errorDerivative (Model &model, const Array< double > &input, const Array< double > &target, Array< double > &derivative) |
| Calculates the derivatives of the mean squared error with respect to the parameters ModelInterface::w. | |
Public Attributes | |
| Array< double > | output |
| Array< double > | locerr |
Definition at line 51 of file DF_MeanSquaredError.h.
| double DF_MeanSquaredError::error | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) | [inline, virtual] |
Calculates the mean squared error between the output and the target vector.
Measures the euklidian distance between the model output model(in), calculated from the input vector in, and the target vector target. The result is then normalized to the number of output neurons. Consider the case of a N-dimensional output vector, i.e. a neural network with N output neurons, and a set of P patterns. In this case the function calculates
| input | Input vector for the model. | |
| target | Target vector. |
Implements ErrorFunction.
Definition at line 87 of file DF_MeanSquaredError.h.
References Model::model(), and output.
| double DF_MeanSquaredError::errorDerivative | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target, | |||
| Array< double > & | derivative | |||
| ) | [inline, virtual] |
Calculates the derivatives of the mean squared error with respect to the parameters ModelInterface::w.
According to the equation in the description for the function error the derivatives of the mean squared error can be calculated The results are written to the vector ModelInterface::dedw.
Usually, as a byproduct of the calculation of the derivative one gets the the error
itself very efficiently. Therefore, the method error gives back this value. This additional effect can be switched of by means of the third parameter (returnError = false).
| input | Input vector for the model. | |
| target | The target vector. | |
| returnError | Determines whether or not to calculate the error itself. By default the error is calculated. |
Reimplemented from ErrorFunction.
Definition at line 149 of file DF_MeanSquaredError.h.
References Model::generalDerivative(), Model::getParameterDimension(), locerr, Model::model(), and output.
| Array<double> DF_MeanSquaredError::locerr |
| Array<double> DF_MeanSquaredError::output |