The Log-Hyperbolic-Cosine loss function is often used to improve variational auto encoder.
More...
#include <log_cosh_loss.hpp>
|
| LogCoshLoss (const double a=1.0) |
| Create the Log-Hyperbolic-Cosine object with the specified parameters. More...
|
|
template<typename PredictionType , typename TargetType > |
PredictionType::elem_type | Forward (const PredictionType &prediction, const TargetType &target) |
| Computes the Log-Hyperbolic-Cosine loss function. 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...
|
|
OutputDataType & | OutputParameter () const |
| Get the output parameter.
|
|
OutputDataType & | OutputParameter () |
| Modify the output parameter.
|
|
double | A () const |
| Get the value of hyperparameter a.
|
|
double & | A () |
| Modify the value of hyperparameter a.
|
|
template<typename Archive > |
void | serialize (Archive &ar, const uint32_t) |
| Serialize the loss function.
|
|
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
-
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). |
◆ LogCoshLoss()
template<typename InputDataType , typename OutputDataType >
Create the Log-Hyperbolic-Cosine object with the specified parameters.
- 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. |
◆ Backward()
template<typename InputDataType , typename OutputDataType >
template<typename PredictionType , typename TargetType , typename LossType >
void mlpack::ann::LogCoshLoss< InputDataType, OutputDataType >::Backward |
( |
const PredictionType & |
prediction, |
|
|
const TargetType & |
target, |
|
|
LossType & |
loss |
|
) |
| |
Ordinary feed backward pass of a neural network.
- Parameters
-
prediction | Predictions used for evaluating the specified loss function. |
target | The target vector. |
loss | The calculated error. |
◆ Forward()
template<typename InputDataType , typename OutputDataType >
template<typename PredictionType , typename TargetType >
PredictionType::elem_type mlpack::ann::LogCoshLoss< InputDataType, OutputDataType >::Forward |
( |
const PredictionType & |
prediction, |
|
|
const TargetType & |
target |
|
) |
| |
Computes the Log-Hyperbolic-Cosine loss function.
- Parameters
-
prediction | Predictions used for evaluating the specified loss function. |
target | Target data to compare with. |
The documentation for this class was generated from the following files: