The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder. More...
Public Member Functions | |
LogCoshLoss (const double a=1.0) | |
Create the Log-Hyperbolic-Cosine object with the specified parameters. More... | |
double | A () const |
Get the value of hyperparameter a. More... | |
double & | A () |
Modify the value of hyperparameter a. More... | |
template < typename PredictionType , typename TargetType , typename LossType > | |
void | Backward (const PredictionType &prediction, const TargetType &target, LossType &loss) |
Ordinary feed backward pass of a neural network. More... | |
template < typename PredictionType , typename TargetType > | |
PredictionType::elem_type | Forward (const PredictionType &prediction, const TargetType &target) |
Computes the Log-Hyperbolic-Cosine loss function. More... | |
OutputDataType & | OutputParameter () const |
Get the output parameter. More... | |
OutputDataType & | OutputParameter () |
Modify the output parameter. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the loss function. More... | |
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.
InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 35 of file log_cosh_loss.hpp.
LogCoshLoss | ( | const double | a = 1.0 | ) |
Create the Log-Hyperbolic-Cosine object with the specified parameters.
a | A 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. |
|
inline |
Get the value of hyperparameter a.
Definition at line 81 of file log_cosh_loss.hpp.
|
inline |
Modify the value of hyperparameter a.
Definition at line 83 of file log_cosh_loss.hpp.
References LogCoshLoss< InputDataType, OutputDataType >::serialize().
void Backward | ( | const PredictionType & | prediction, |
const TargetType & | target, | ||
LossType & | loss | ||
) |
Ordinary feed backward pass of a neural network.
prediction | Predictions used for evaluating the specified loss function. |
target | The target vector. |
loss | The calculated error. |
PredictionType::elem_type Forward | ( | const PredictionType & | prediction, |
const TargetType & | target | ||
) |
Computes the Log-Hyperbolic-Cosine loss function.
prediction | Predictions used for evaluating the specified loss function. |
target | Target data to compare with. |
|
inline |
Get the output parameter.
Definition at line 76 of file log_cosh_loss.hpp.
|
inline |
Modify the output parameter.
Definition at line 78 of file log_cosh_loss.hpp.
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the loss function.
Referenced by LogCoshLoss< InputDataType, OutputDataType >::A().