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... | |
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).
InputDataType | Type of the input data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
OutputDataType | Type of the output data (arma::colvec, arma::mat, arma::sp_mat or arma::cube). |
Definition at line 87 of file layer_types.hpp.
VRClassReward | ( | const double | scale = 1 , |
const bool | sizeAverage = true |
||
) |
Create the VRClassReward object.
scale | Parameter used to scale the reward. |
sizeAverage | Take the average over all batches. |
|
inline |
Definition at line 92 of file vr_class_reward.hpp.
|
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.
input | The propagated input activation. |
target | The target vector, that contains the class index in the range between 1 and the number of classes. |
output | The calculated error. |
|
inline |
Get the delta.
Definition at line 82 of file vr_class_reward.hpp.
|
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.
input | Input data that contains the log-probabilities for each class. |
target | The target vector, that contains the class index in the range between 1 and the number of classes. |
|
inline |
Get the network modules.
Definition at line 102 of file vr_class_reward.hpp.
|
inline |
Get the output parameter.
Definition at line 77 of file vr_class_reward.hpp.
|
inline |
Modify the output parameter.
Definition at line 79 of file vr_class_reward.hpp.
|
inline |
Get the value of scale parameter.
Definition at line 108 of file vr_class_reward.hpp.
References VRClassReward< InputDataType, OutputDataType >::serialize().
void serialize | ( | Archive & | , |
const uint32_t | |||
) |
Serialize the layer.
Referenced by VRClassReward< InputDataType, OutputDataType >::Scale().
|
inline |
Get the value of parameter sizeAverage.
Definition at line 105 of file vr_class_reward.hpp.