mlpack 3.4.2
Public Member Functions | List of all members
LogCoshLoss< InputDataType, OutputDataType > Class Template Reference

The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder. More...

#include <log_cosh_loss.hpp>

Public Member Functions

 LogCoshLoss (const double a=1.0)
 Create the Log-Hyperbolic-Cosine object with the specified parameters. More...
 
double & A ()
 Modify the value of hyperparameter a. More...
 
double A () const
 Get the value of hyperparameter a. More...
 
template<typename InputType , typename TargetType , typename OutputType >
void Backward (const InputType &input, const TargetType &target, OutputType &output)
 Ordinary feed backward pass of a neural network. More...
 
template<typename InputType , typename TargetType >
InputType::elem_type Forward (const InputType &input, const TargetType &target)
 Computes the Log-Hyperbolic-Cosine loss function. More...
 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...
 
OutputDataType & OutputParameter () const
 Get the output parameter. More...
 
template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 Serialize the loss function. More...
 

Detailed Description

template<typename InputDataType = arma::mat, typename OutputDataType = arma::mat>
class mlpack::ann::LogCoshLoss< InputDataType, OutputDataType >

The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder.

This function is the log of hyperbolic cosine of difference between true values and predicted values.

Template Parameters
InputDataTypeType of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).
OutputDataTypeType of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube).

Definition at line 35 of file log_cosh_loss.hpp.

Constructor & Destructor Documentation

◆ LogCoshLoss()

LogCoshLoss ( const double  a = 1.0)

Create the Log-Hyperbolic-Cosine object with the specified parameters.

Parameters
aA double type value for smoothening loss function. It must be positive a real number, Sharpness of loss function is directly proportional to a. It can also act as a scaling factor hence making the loss function more sensitive to small losses around the origin. Default value = 1.0.

Member Function Documentation

◆ A() [1/2]

double & A ( )
inline

Modify the value of hyperparameter a.

Definition at line 81 of file log_cosh_loss.hpp.

◆ A() [2/2]

double A ( ) const
inline

Get the value of hyperparameter a.

Definition at line 79 of file log_cosh_loss.hpp.

◆ Backward()

void Backward ( const InputType &  input,
const TargetType &  target,
OutputType &  output 
)

Ordinary feed backward pass of a neural network.

Parameters
inputThe propagated input activation.
targetThe target vector.
outputThe calculated error.

◆ Forward()

InputType::elem_type Forward ( const InputType &  input,
const TargetType &  target 
)

Computes the Log-Hyperbolic-Cosine loss function.

Parameters
inputInput data used for evaluating the specified function.
targetTarget data to compare with.

◆ OutputParameter() [1/2]

OutputDataType & OutputParameter ( )
inline

Modify the output parameter.

Definition at line 76 of file log_cosh_loss.hpp.

◆ OutputParameter() [2/2]

OutputDataType & OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 74 of file log_cosh_loss.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned int   
)

Serialize the loss function.


The documentation for this class was generated from the following file: