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

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

 
std::vector< LayerTypes<> > & Model ()
 Get the network modules. More...

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

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

 
double Scale () const
 Get the value of scale parameter. More...

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

 
bool SizeAverage () const
 Get the value of parameter sizeAverage. 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 87 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 92 of file vr_class_reward.hpp.

◆ Add() [2/2]

void Add ( LayerTypes<>  layer)
inline

Definition at line 99 of file vr_class_reward.hpp.

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

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

◆ Model()

std::vector<LayerTypes<> >& Model ( )
inline

Get the network modules.

Definition at line 102 of file vr_class_reward.hpp.

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

◆ Scale()

double Scale ( ) const
inline

Get the value of scale parameter.

Definition at line 108 of file vr_class_reward.hpp.

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

◆ serialize()

void serialize ( Archive &  ,
const uint32_t   
)

Serialize the layer.

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

◆ SizeAverage()

bool SizeAverage ( ) const
inline

Get the value of parameter sizeAverage.

Definition at line 105 of file vr_class_reward.hpp.


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