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 | |
void | Backward (const InputType &input, const TargetType &target, OutputType &output) |
Ordinary feed backward pass of a neural network. More... | |
template | |
InputType::elem_type | Forward (const InputType &input, 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 | |
void | serialize (Archive &ar, const unsigned int) |
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 79 of file log_cosh_loss.hpp.
|
inline |
Modify the value of hyperparameter a.
Definition at line 81 of file log_cosh_loss.hpp.
References LogCoshLoss< InputDataType, OutputDataType >::serialize().
void Backward | ( | const InputType & | input, |
const TargetType & | target, | ||
OutputType & | output | ||
) |
Ordinary feed backward pass of a neural network.
input | The propagated input activation. |
target | The target vector. |
output | The calculated error. |
InputType::elem_type Forward | ( | const InputType & | input, |
const TargetType & | target | ||
) |
Computes the Log-Hyperbolic-Cosine loss function.
input | Input data used for evaluating the specified function. |
target | Target data to compare with. |
|
inline |
Get the output parameter.
Definition at line 74 of file log_cosh_loss.hpp.
|
inline |
Modify the output parameter.
Definition at line 76 of file log_cosh_loss.hpp.
void serialize | ( | Archive & | ar, |
const unsigned | int | ||
) |
Serialize the loss function.
Referenced by LogCoshLoss< InputDataType, OutputDataType >::A().