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>
70 const TargetType& target,
79 double A()
const {
return a; }
81 double&
A() {
return a; }
86 template<
typename Archive>
91 OutputDataType outputParameter;
101#include "log_cosh_loss_impl.hpp"
The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder.
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.
LogCoshLoss(const double a=1.0)
Create the Log-Hyperbolic-Cosine object with the specified parameters.
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.
OutputDataType & OutputParameter()
Modify the output parameter.
double & A()
Modify the value of hyperparameter a.
void serialize(Archive &ar, const unsigned int)
Serialize the loss function.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.