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;
103 #include "log_cosh_loss_impl.hpp" void serialize(Archive &ar, const uint32_t)
Serialize the loss function.
void Backward(const PredictionType &prediction, const TargetType &target, LossType &loss)
Ordinary feed backward pass of a neural network.
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.
LogCoshLoss(const double a=1.0)
Create the Log-Hyperbolic-Cosine object with the specified parameters.
OutputDataType & OutputParameter() const
Get the output parameter.
double & A()
Modify the value of hyperparameter a.
The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder...
double A() const
Get the value of hyperparameter a.
PredictionType::elem_type Forward(const PredictionType &prediction, const TargetType &target)
Computes the Log-Hyperbolic-Cosine loss function.