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  double Forward(const InputType&& input, const TargetType&& target);
50 
58  template<typename InputType, typename TargetType, typename OutputType>
59  void Backward(const InputType&& input,
60  const TargetType&& target,
61  OutputType&& output);
62 
64  OutputDataType& OutputParameter() const { return outputParameter; }
66  OutputDataType& OutputParameter() { return outputParameter; }
67 
71  template<typename Archive>
72  void serialize(Archive& ar, const unsigned int /* version */);
73 
74  private:
76  OutputDataType outputParameter;
77 }; // class MeanSquaredError
78 
79 } // namespace ann
80 } // namespace mlpack
81 
82 // Include implementation.
83 #include "mean_squared_error_impl.hpp"
84 
85 #endif
strip_type.hpp
Definition: add_to_po.hpp:21
double Forward(const InputType &&input, 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.
MeanSquaredError()
Create the MeanSquaredError object.
void Backward(const InputType &&input, const TargetType &&target, OutputType &&output)
Ordinary feed backward pass of a neural network.
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.
OutputDataType & OutputParameter()
Modify the output parameter.