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;
96 #include "l1_loss_impl.hpp" void serialize(Archive &ar, const uint32_t)
Serialize the layer.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the L1 Loss function.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType & OutputParameter()
Modify the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter() const
Get the output parameter.
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
bool & Mean()
Set the value of reduction type.
bool Mean() const
Get the value of reduction type.
L1Loss(const bool mean=true)
Create the L1Loss object.
The L1 loss is a loss function that measures the mean absolute error (MAE) between each element in th...