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 
17 namespace mlpack {
18 namespace ann {
19 
30 template <
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
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
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.
MeanSquaredError()
Create the MeanSquaredError object.
The mean squared error performance function measures the network&#39;s performance according to the mean ...
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the mean squared error function.
OutputDataType & OutputParameter()
Modify the output parameter.