mlpack  3.1.1
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);
57  template<typename InputType, typename TargetType, typename OutputType>
58  void Backward(const InputType&& input,
59  const TargetType&& target,
60  OutputType&& output);
61 
63  OutputDataType& OutputParameter() const { return outputParameter; }
65  OutputDataType& OutputParameter() { return outputParameter; }
66 
70  template<typename Archive>
71  void serialize(Archive& ar, const unsigned int /* version */);
72 
73  private:
75  OutputDataType outputParameter;
76 }; // class MeanSquaredError
77 
78 } // namespace ann
79 } // namespace mlpack
80 
81 // Include implementation.
82 #include "mean_squared_error_impl.hpp"
83 
84 #endif
prereqs.hpp
mlpack::ann::MeanSquaredError::serialize
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
mlpack::ann::MeanSquaredError::Forward
double Forward(const InputType &&input, const TargetType &&target)
Computes the mean squared error function.
mlpack::ann::MeanSquaredError::MeanSquaredError
MeanSquaredError()
Create the MeanSquaredError object.
mlpack
@serialization.hpp
Definition: add_to_po.hpp:21
mlpack::ann::MeanSquaredError::Backward
void Backward(const InputType &&input, const TargetType &&target, OutputType &&output)
Ordinary feed backward pass of a neural network.
mlpack::ann::MeanSquaredError::OutputParameter
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: mean_squared_error.hpp:65
mlpack::ann::MeanSquaredError
The mean squared error performance function measures the network's performance according to the mean ...
Definition: mean_squared_error.hpp:34
mlpack::ann::MeanSquaredError::OutputParameter
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: mean_squared_error.hpp:63