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
57 template<
typename InputType,
typename TargetType>
58 typename InputType::elem_type
Forward(
const InputType& input,
59 const TargetType& target);
68 template<
typename InputType,
typename TargetType,
typename OutputType>
69 void Backward(
const InputType& input,
70 const TargetType& target,
79 double A()
const {
return a; }
81 double&
A() {
return a; }
86 template<
typename Archive>
87 void serialize(Archive& ar,
const unsigned int );
91 OutputDataType outputParameter;
101 #include "log_cosh_loss_impl.hpp" 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.
void serialize(Archive &ar, const unsigned int)
Serialize the loss function.
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.
InputType::elem_type Forward(const InputType &input, const TargetType &target)
Computes the Log-Hyperbolic-Cosine loss function.
void Backward(const InputType &input, const TargetType &target, OutputType &output)
Ordinary feed backward pass of a neural network.