mlpack  3.4.2
mean_absolute_percentage_error.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_ABSOLUTE_PERCENTAGE_ERROR_HPP
13 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_MEAN_ABSOLUTE_PERCENTAGE_ERROR_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace ann {
19 
45 template <
46  typename InputDataType = arma::mat,
47  typename OutputDataType = arma::mat
48 >
50 {
51  public:
56 
63  template<typename InputType, typename TargetType>
64  typename InputType::elem_type Forward(const InputType& input,
65  const TargetType& target);
66 
74  template<typename InputType, typename TargetType, typename OutputType>
75  void Backward(const InputType& input,
76  const TargetType& target,
77  OutputType& output);
78 
80  OutputDataType& OutputParameter() const { return outputParameter; }
82  OutputDataType& OutputParameter() { return outputParameter; }
83 
87  template<typename Archive>
88  void serialize(Archive& ar, const unsigned int /* version */);
89 
90  private:
92  OutputDataType outputParameter;
93 }; // class MeanAbsolutePercentageError
94 
95 } // namespace ann
96 } // namespace mlpack
97 
98 // Include implementation.
99 #include "mean_absolute_percentage_error_impl.hpp"
100 
101 #endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::ann::MeanAbsolutePercentageError::serialize
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
mlpack::ann::MeanAbsolutePercentageError::Backward
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
mlpack::ann::MeanAbsolutePercentageError
The mean absolute percentage error performance function measures the network's performance according ...
Definition: mean_absolute_percentage_error.hpp:50
mlpack::ann::MeanAbsolutePercentageError::OutputParameter
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: mean_absolute_percentage_error.hpp:82
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::ann::MeanAbsolutePercentageError::OutputParameter
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: mean_absolute_percentage_error.hpp:80
mlpack::ann::MeanAbsolutePercentageError::Forward
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the mean absolute percentage error function.
mlpack::ann::MeanAbsolutePercentageError::MeanAbsolutePercentageError
MeanAbsolutePercentageError()
Create the MeanAbsolutePercentageError object.