12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_L1_LOSS_HPP 13 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_L1_LOSS_HPP 30 typename InputDataType = arma::mat,
31 typename OutputDataType = arma::mat
42 L1Loss(
const bool mean =
true);
51 template<
typename PredictionType,
typename TargetType>
52 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
53 const TargetType& target);
63 template<
typename PredictionType,
typename TargetType,
typename LossType>
64 void Backward(
const PredictionType& prediction,
65 const TargetType& target,
74 bool Mean()
const {
return mean; }
76 bool&
Mean() {
return mean; }
81 template<
typename Archive>
82 void serialize(Archive& ar,
const uint32_t );
86 OutputDataType outputParameter;
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: l1_loss.hpp:69
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.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: l1_loss_impl.hpp:53
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: l1_loss_impl.hpp:43
L1Loss(const bool mean=true)
Create the L1Loss object.
Definition: l1_loss_impl.hpp:22
bool & Mean()
Set the value of reduction type.
Definition: l1_loss.hpp:76
bool Mean() const
Get the value of reduction type.
Definition: l1_loss.hpp:74
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the L1 Loss function.
Definition: l1_loss_impl.hpp:31
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: l1_loss.hpp:71
The L1 loss is a loss function that measures the mean absolute error (MAE) between each element in th...
Definition: l1_loss.hpp:33