13 #ifndef MLPACK_METHODS_ANN_LOSS_FUNCTION_LOG_COSH_LOSS_HPP 14 #define MLPACK_METHODS_ANN_LOSS_FUNCTION_LOG_COSH_LOSS_HPP 32 typename InputDataType = arma::mat,
33 typename OutputDataType = arma::mat
58 template<
typename PredictionType,
typename TargetType>
59 typename PredictionType::elem_type
Forward(
const PredictionType& prediction,
60 const TargetType& target);
70 template<
typename PredictionType,
typename TargetType,
typename LossType>
71 void Backward(
const PredictionType& prediction,
72 const TargetType& target,
81 double A()
const {
return a; }
83 double&
A() {
return a; }
88 template<
typename Archive>
89 void serialize(Archive& ar,
const uint32_t );
93 OutputDataType outputParameter;
void serialize(Archive &ar, const uint32_t)
Serialize the loss function.
Definition: log_cosh_loss_impl.hpp:51
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Log-Hyperbolic-Cosine loss function.
Definition: log_cosh_loss_impl.hpp:32
double & A()
Modify the value of hyperparameter a.
Definition: log_cosh_loss.hpp:83
LogCoshLoss(const double a=1.0)
Create the Log-Hyperbolic-Cosine object with the specified parameters.
Definition: log_cosh_loss_impl.hpp:23
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 Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
Definition: log_cosh_loss_impl.hpp:41
double A() const
Get the value of hyperparameter a.
Definition: log_cosh_loss.hpp:81
The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder...
Definition: log_cosh_loss.hpp:35
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: log_cosh_loss.hpp:78
OutputDataType & OutputParameter() const
Get the output parameter.
Definition: log_cosh_loss.hpp:76