VRClassReward< InputDataType, OutputDataType > Class Template Reference

Implementation of the variance reduced classification reinforcement layer. More...

Public Member Functions

 VRClassReward (const double scale=1, const bool sizeAverage=true)
 Create the VRClassReward object. More...

 
template<class LayerType , class... Args>
void Add (Args... args)
 
void Add (LayerTypes<> layer)
 
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...

 
OutputDataType & Delta () const
 Get the delta. More...

 
OutputDataType & Delta ()
 Modify the delta. More...

 
bool Deterministic () const
 Get the value of the deterministic parameter. More...

 
bool & Deterministic ()
 Modify the value of the deterministic parameter. More...

 
template
<
typename
InputType
,
typename
TargetType
>
double Forward (const InputType &&input, const TargetType &&target)
 Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f. More...

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

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

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

 

Detailed Description


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

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

Implementation of the variance reduced classification reinforcement layer.

This layer is meant to be used in combination with the reinforce normal layer (ReinforceNormalLayer), which expects that an reward: (1 for success, 0 otherwise).

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 66 of file layer_types.hpp.

Constructor & Destructor Documentation

◆ VRClassReward()

VRClassReward ( const double  scale = 1,
const bool  sizeAverage = true 
)

Create the VRClassReward object.

Parameters
scaleParameter used to scale the reward.
sizeAverageTake the average over all batches.

Member Function Documentation

◆ Add() [1/2]

void Add ( Args...  args)
inline

Definition at line 97 of file vr_class_reward.hpp.

◆ Add() [2/2]

void Add ( LayerTypes<>  layer)
inline

◆ Backward()

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

Ordinary feed backward pass of a neural network.

The negative log likelihood layer expectes that the input contains log-probabilities for each class. The layer also expects a class index, in the range between 1 and the number of classes, as target when calling the Forward function.

Parameters
inputThe propagated input activation.
targetThe target vector, that contains the class index in the range between 1 and the number of classes.
outputThe calculated error.

◆ Delta() [1/2]

OutputDataType& Delta ( ) const
inline

Get the delta.

Definition at line 82 of file vr_class_reward.hpp.

◆ Delta() [2/2]

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 84 of file vr_class_reward.hpp.

◆ Deterministic() [1/2]

bool Deterministic ( ) const
inline

Get the value of the deterministic parameter.

Definition at line 87 of file vr_class_reward.hpp.

◆ Deterministic() [2/2]

bool& Deterministic ( )
inline

Modify the value of the deterministic parameter.

Definition at line 89 of file vr_class_reward.hpp.

◆ Forward()

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

Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activity forward through f.

Parameters
inputInput data that contains the log-probabilities for each class.
targetThe target vector, that contains the class index in the range between 1 and the number of classes.

◆ OutputParameter() [1/2]

OutputDataType& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 77 of file vr_class_reward.hpp.

◆ OutputParameter() [2/2]

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 79 of file vr_class_reward.hpp.

◆ serialize()

void serialize ( Archive &  ,
const unsigned  int 
)

Serialize the layer.

Referenced by VRClassReward< InputDataType, OutputDataType >::Add().


The documentation for this class was generated from the following files:
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-3.2.1/src/mlpack/methods/ann/layer/layer_types.hpp
  • /home/jenkins-mlpack/mlpack.org/_src/mlpack-3.2.1/src/mlpack/methods/ann/layer/vr_class_reward.hpp