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 
49  template<typename PredictionType, typename TargetType>
50  typename PredictionType::elem_type Forward(const PredictionType& prediction,
51  const TargetType& target);
52 
61  template<typename PredictionType, typename TargetType, typename LossType>
62  void Backward(const PredictionType& prediction,
63  const TargetType& target,
64  LossType& loss);
65 
67  OutputDataType& OutputParameter() const { return outputParameter; }
69  OutputDataType& OutputParameter() { return outputParameter; }
70 
74  template<typename Archive>
75  void serialize(Archive& ar, const uint32_t /* version */);
76 
77  private:
79  OutputDataType outputParameter;
80 }; // class MeanSquaredError
81 
82 } // namespace ann
83 } // namespace mlpack
84 
85 // Include implementation.
86 #include "mean_squared_error_impl.hpp"
87 
88 #endif
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the mean squared error function.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter() const
Get the output parameter.
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
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 ...
OutputDataType & OutputParameter()
Modify the output parameter.