CrossEntropyError< InputDataType, OutputDataType > Class Template Reference

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

Public Member Functions

 CrossEntropyError (const double eps=1e-10)
 Create the CrossEntropyError 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...

 
double Eps () const
 Get the epsilon. More...

 
double & Eps ()
 Modify the epsilon. More...

 
template
<
typename
InputType
,
typename
TargetType
>
double Forward (const InputType &&input, const TargetType &&target)
 Computes the cross-entropy 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 unsigned int)
 Serialize the layer. More...

 

Detailed Description


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

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

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

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 34 of file cross_entropy_error.hpp.

Constructor & Destructor Documentation

◆ CrossEntropyError()

CrossEntropyError ( const double  eps = 1e-10)

Create the CrossEntropyError object.

Parameters
epsThe minimum value used for computing logarithms and denominators in a numerically stable way.

Member Function Documentation

◆ 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.

◆ Eps() [1/2]

double Eps ( ) const
inline

Get the epsilon.

Definition at line 72 of file cross_entropy_error.hpp.

◆ Eps() [2/2]

double& Eps ( )
inline

Modify the epsilon.

Definition at line 74 of file cross_entropy_error.hpp.

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

◆ Forward()

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

Computes the cross-entropy function.

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 67 of file cross_entropy_error.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 69 of file cross_entropy_error.hpp.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 
)

Serialize the layer.

Referenced by CrossEntropyError< InputDataType, OutputDataType >::Eps().


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