mlpack  3.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
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 unsigned int)
 Serialize the layer. More...
 
bool SizeAverage () const
 Get the value of parameter sizeAverage. More...
 

Detailed Description

template<typename InputDataType, typename OutputDataType>
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 79 of file layer_types.hpp.

Constructor & Destructor Documentation

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

void Add ( Args...  args)
inline

Definition at line 92 of file vr_class_reward.hpp.

void Add ( LayerTypes<>  layer)
inline

Definition at line 99 of file vr_class_reward.hpp.

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.
OutputDataType& Delta ( ) const
inline

Get the delta.

Definition at line 82 of file vr_class_reward.hpp.

OutputDataType& Delta ( )
inline

Modify the delta.

Definition at line 84 of file vr_class_reward.hpp.

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.
std::vector<LayerTypes<> >& Model ( )
inline

Get the network modules.

Definition at line 102 of file vr_class_reward.hpp.

OutputDataType& OutputParameter ( ) const
inline

Get the output parameter.

Definition at line 77 of file vr_class_reward.hpp.

OutputDataType& OutputParameter ( )
inline

Modify the output parameter.

Definition at line 79 of file vr_class_reward.hpp.

double Scale ( ) const
inline

Get the value of scale parameter.

Definition at line 108 of file vr_class_reward.hpp.

void serialize ( Archive &  ,
const unsigned  int 
)

Serialize the layer.

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: