SigmoidCrossEntropyError< InputDataType, OutputDataType > Class Template Reference

The SigmoidCrossEntropyError performance function measures the network's performance according to the cross-entropy function between the input and target distributions. More...

Public Member Functions

 SigmoidCrossEntropyError ()
 Create the SigmoidCrossEntropyError object. 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
>
double Forward (const InputType &&input, const TargetType &&target)
 Computes the Sigmoid CrossEntropy Error functions. More...

 
OutputDataType & OutputParameter () const
 Get the output parameter. More...

 
OutputDataType & OutputParameter ()
 Modify the output parameter. More...

 
template
<
typename
Archive
>
void serialize (Archive &ar, const unsigned int)
 Serialize the layer. More...

 

Detailed Description


template
<
typename
InputDataType
=
arma::mat
,
typename
OutputDataType
=
arma::mat
>

class mlpack::ann::SigmoidCrossEntropyError< InputDataType, OutputDataType >

The SigmoidCrossEntropyError performance function measures the network's performance according to the cross-entropy function between the input and target distributions.

This function calculates the cross entropy given the real values instead of providing the sigmoid activations. The function uses this equivalent formulation: $max(x, 0) - x * z + \log(1 + e^{-|x|})$ where x = input and z = target.

For more information, see the following paper.

@article{Janocha2017
title = {On Loss Functions for Deep Neural Networks in Classification},
author = {Katarzyna Janocha, Wojciech Marian Czarnecki},
url = {http://arxiv.org/abs/1702.05659},
journal = {CoRR},
eprint = {arXiv:1702.05659},
year = {2017}
}
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 52 of file sigmoid_cross_entropy_error.hpp.

Constructor & Destructor Documentation

◆ SigmoidCrossEntropyError()

Member Function Documentation

◆ Backward()

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

Ordinary feed backward pass of a neural network.

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

◆ Forward()

double Forward ( const InputType &&  input,
const TargetType &&  target 
)
inline

Computes the Sigmoid CrossEntropy Error functions.

Parameters
inputInput data used for evaluating the specified function.
targetThe target vector.

◆ OutputParameter() [1/2]

OutputDataType& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 82 of file sigmoid_cross_entropy_error.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 84 of file sigmoid_cross_entropy_error.hpp.

References SigmoidCrossEntropyError< InputDataType, OutputDataType >::serialize().

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

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