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
50 template<
typename InputType,
typename TargetType>
51 typename InputType::elem_type
Forward(
const InputType& input,
52 const TargetType& target);
61 template<
typename InputType,
typename TargetType,
typename OutputType>
63 const TargetType& target,
72 bool Mean()
const {
return mean; }
74 bool&
Mean() {
return mean; }
79 template<
typename Archive>
84 OutputDataType outputParameter;
94#include "l1_loss_impl.hpp"
The L1 loss is a loss function that measures the mean absolute error (MAE) between each element in th...
bool & Mean()
Set the value of reduction type.
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.
L1Loss(const bool mean=true)
Create the L1Loss object.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the L1 Loss function.
bool Mean() const
Get the value of reduction type.
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.
The core includes that mlpack expects; standard C++ includes and Armadillo.