mlpack 3.4.2
mean_squared_error.hpp
Go to the documentation of this file.
1
12#ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_SQUARED_ERROR_HPP
13#define MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_SQUARED_ERROR_HPP
14
15#include <mlpack/prereqs.hpp>
16
17namespace mlpack {
18namespace ann {
19
30template <
31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
33>
35{
36 public:
41
48 template<typename InputType, typename TargetType>
49 typename InputType::elem_type Forward(const InputType& input,
50 const TargetType& target);
51
59 template<typename InputType, typename TargetType, typename OutputType>
60 void Backward(const InputType& input,
61 const TargetType& target,
62 OutputType& output);
63
65 OutputDataType& OutputParameter() const { return outputParameter; }
67 OutputDataType& OutputParameter() { return outputParameter; }
68
72 template<typename Archive>
73 void serialize(Archive& ar, const unsigned int /* version */);
74
75 private:
77 OutputDataType outputParameter;
78}; // class MeanSquaredError
79
80} // namespace ann
81} // namespace mlpack
82
83// Include implementation.
84#include "mean_squared_error_impl.hpp"
85
86#endif
The mean squared error performance function measures the network's performance according to the mean ...
MeanSquaredError()
Create the MeanSquaredError object.
OutputDataType & OutputParameter() const
Get the output parameter.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the mean squared error function.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.