12 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_HUBER_LOSS_HPP 13 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_HUBER_LOSS_HPP 33 typename InputDataType = arma::mat,
34 typename OutputDataType = arma::mat
46 HuberLoss(
const double delta = 1.0,
const bool mean =
true);
55 template<
typename PredictionType,
typename TargetType>
56 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
57 const TargetType& target);
67 template<
typename PredictionType,
typename TargetType,
typename LossType>
68 void Backward(
const PredictionType& prediction,
69 const TargetType& target,
78 double Delta()
const {
return delta; }
80 double&
Delta() {
return delta; }
83 bool Mean()
const {
return mean; }
85 bool&
Mean() {
return mean; }
90 template<
typename Archive>
91 void serialize(Archive& ar,
const uint32_t );
95 OutputDataType outputParameter;
The Huber loss is a loss function used in robust regression, that is less sensitive to outliers in da...
Definition: huber_loss.hpp:36
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: huber_loss_impl.hpp:72
double Delta() const
Get the value of delta.
Definition: huber_loss.hpp:78
The core includes that mlpack expects; standard C++ includes and Armadillo.
HuberLoss(const double delta=1.0, const bool mean=true)
Create the HuberLoss object.
Definition: huber_loss_impl.hpp:22
double & Delta()
Set the value of delta.
Definition: huber_loss.hpp:80
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: huber_loss.hpp:75
bool Mean() const
Get the value of reduction type.
Definition: huber_loss.hpp:83
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: huber_loss_impl.hpp:51
bool & Mean()
Set the value of reduction type.
Definition: huber_loss.hpp:85
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: huber_loss.hpp:73
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Huber Loss function.
Definition: huber_loss_impl.hpp:34