mlpack  3.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the mean absolute percentage error function.
MeanAbsolutePercentageError()
Create the MeanAbsolutePercentageError object.
The mean absolute percentage error performance function measures the network&#39;s performance according ...
OutputDataType & OutputParameter() const
Get the output parameter.