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
17namespace mlpack {
18namespace ann {
19
45template <
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
The mean absolute percentage error performance function measures the network's performance according ...
MeanAbsolutePercentageError()
Create the MeanAbsolutePercentageError object.
OutputDataType & OutputParameter() const
Get the output parameter.
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.
OutputDataType & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.