|
| RNN (const size_t rho, const bool single=false, OutputLayerType outputLayer=OutputLayerType(), InitializationRuleType initializeRule=InitializationRuleType()) |
| Create the RNN object with the given predictors and responses set (this is the set that is used to train the network) and the given optimizer. More...
|
|
| RNN (const arma::mat &predictors, const arma::mat &responses, const size_t rho, const bool single=false, OutputLayerType outputLayer=OutputLayerType(), InitializationRuleType initializeRule=InitializationRuleType()) |
| Create the RNN object with the given predictors and responses set (this is the set that is used to train the network) and the given optimizer. More...
|
|
| ~RNN () |
| Destructor to release allocated memory. More...
|
|
template<typename LayerType > |
void | Add (const LayerType &layer) |
|
template<class LayerType , class... Args> |
void | Add (Args...args) |
|
void | Add (LayerTypes layer) |
|
double | Evaluate (const arma::mat &, const size_t i, const bool deterministic=true) |
| Evaluate the recurrent neural network with the given parameters. More...
|
|
void | Gradient (const arma::mat ¶meters, const size_t i, arma::mat &gradient) |
| Evaluate the gradient of the recurrent neural network with the given parameters, and with respect to only one point in the dataset. More...
|
|
size_t | NumFunctions () const |
| Return the number of separable functions (the number of predictor points). More...
|
|
const arma::mat & | Parameters () const |
| Return the initial point for the optimization. More...
|
|
arma::mat & | Parameters () |
| Modify the initial point for the optimization. More...
|
|
void | Predict (arma::mat &predictors, arma::mat &responses) |
| Predict the responses to a given set of predictors. More...
|
|
template<typename Archive > |
void | Serialize (Archive &ar, const unsigned int) |
| Serialize the model. More...
|
|
template<template< typename > class OptimizerType = mlpack::optimization::SGD> |
void | Train (const arma::mat &predictors, const arma::mat &responses, OptimizerType< NetworkType > &optimizer) |
| Train the recurrent neural network on the given input data using the given optimizer. More...
|
|
template<template< typename > class OptimizerType = mlpack::optimization::SGD> |
void | Train (const arma::mat &predictors, const arma::mat &responses) |
| Train the recurrent neural network on the given input data. More...
|
|
|
void | Backward () |
| The Backward algorithm (part of the Forward-Backward algorithm). More...
|
|
void | Forward (arma::mat &&input) |
| The Forward algorithm (part of the Forward-Backward algorithm). More...
|
|
void | Gradient () |
| Iterate through all layer modules and update the the gradient using the layer defined optimizer. More...
|
|
void | ResetDeterministic () |
| Reset the module status by setting the current deterministic parameter for all modules that implement the Deterministic function. More...
|
|
void | ResetGradients (arma::mat &gradient) |
| Reset the gradient for all modules that implement the Gradient function. More...
|
|
void | ResetParameters () |
| Reset the module infomration (weights/parameters). More...
|
|
void | SinglePredict (const arma::mat &predictors, arma::mat &responses) |
|
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
class mlpack::ann::RNN< OutputLayerType, InitializationRuleType >
Implementation of a standard recurrent neural network container.
- Template Parameters
-
OutputLayerType | The output layer type used to evaluate the network. |
InitializationRuleType | Rule used to initialize the weight matrix. |
Definition at line 40 of file rnn.hpp.
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
mlpack::ann::RNN< OutputLayerType, InitializationRuleType >::RNN |
( |
const size_t |
rho, |
|
|
const bool |
single = false , |
|
|
OutputLayerType |
outputLayer = OutputLayerType() , |
|
|
InitializationRuleType |
initializeRule = InitializationRuleType() |
|
) |
| |
Create the RNN object with the given predictors and responses set (this is the set that is used to train the network) and the given optimizer.
Optionally, specify which initialize rule and performance function should be used.
- Parameters
-
rho | Maximum number of steps to backpropagate through time (BPTT). |
single | Predict only the last element of the input sequence. |
outputLayer | Output layer used to evaluate the network. |
initializeRule | Optional instantiated InitializationRule object for initializing the network parameter. |
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
mlpack::ann::RNN< OutputLayerType, InitializationRuleType >::RNN |
( |
const arma::mat & |
predictors, |
|
|
const arma::mat & |
responses, |
|
|
const size_t |
rho, |
|
|
const bool |
single = false , |
|
|
OutputLayerType |
outputLayer = OutputLayerType() , |
|
|
InitializationRuleType |
initializeRule = InitializationRuleType() |
|
) |
| |
Create the RNN object with the given predictors and responses set (this is the set that is used to train the network) and the given optimizer.
Optionally, specify which initialize rule and performance function should be used.
- Parameters
-
predictors | Input training variables. |
responses | Outputs results from input training variables. |
rho | Maximum number of steps to backpropagate through time (BPTT). |
single | Predict only the last element of the input sequence. |
outputLayer | Output layer used to evaluate the network. |
initializeRule | Optional instantiated InitializationRule object for initializing the network parameter. |
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
void mlpack::ann::RNN< OutputLayerType, InitializationRuleType >::Gradient |
( |
const arma::mat & |
parameters, |
|
|
const size_t |
i, |
|
|
arma::mat & |
gradient |
|
) |
| |
Evaluate the gradient of the recurrent neural network with the given parameters, and with respect to only one point in the dataset.
This is useful for optimizers such as SGD, which require a separable objective function.
- Parameters
-
parameters | Matrix of the model parameters to be optimized. |
i | Index of points to use for objective function gradient evaluation. |
gradient | Matrix to output gradient into. |
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
template<template< typename > class OptimizerType = mlpack::optimization::SGD>
void mlpack::ann::RNN< OutputLayerType, InitializationRuleType >::Train |
( |
const arma::mat & |
predictors, |
|
|
const arma::mat & |
responses, |
|
|
OptimizerType< NetworkType > & |
optimizer |
|
) |
| |
Train the recurrent neural network on the given input data using the given optimizer.
This will use the existing model parameters as a starting point for the optimization. If this is not what you want, then you should access the parameters vector directly with Parameters() and modify it as desired.
- Template Parameters
-
OptimizerType | Type of optimizer to use to train the model. |
- Parameters
-
predictors | Input training variables. |
responses | Outputs results from input training variables. |
optimizer | Instantiated optimizer used to train the model. |
template<typename OutputLayerType = NegativeLogLikelihood<>, typename InitializationRuleType = RandomInitialization>
template<template< typename > class OptimizerType = mlpack::optimization::SGD>
void mlpack::ann::RNN< OutputLayerType, InitializationRuleType >::Train |
( |
const arma::mat & |
predictors, |
|
|
const arma::mat & |
responses |
|
) |
| |
Train the recurrent neural network on the given input data.
By default, the SGD optimization algorithm is used, but others can be specified (such as mlpack::optimization::RMSprop).
This will use the existing model parameters as a starting point for the optimization. If this is not what you want, then you should access the parameters vector directly with Parameters() and modify it as desired.
- Template Parameters
-
OptimizerType | Type of optimizer to use to train the model. |
- Parameters
-
predictors | Input training variables. |
responses | Outputs results from input training variables. |