Implementation of a standard bidirectional recurrent neural network container.
More...
|
| BRNN (const size_t rho, const bool single=false, OutputLayerType outputLayer=OutputLayerType(), MergeLayerType *mergeLayer=new MergeLayerType(), MergeOutputType *mergeOutput=new MergeOutputType(), InitializationRuleType initializeRule=InitializationRuleType()) |
| Create the BRNN object. More...
|
|
| ~BRNN () |
|
template |
void | Add (Args... args) |
|
void | Add (LayerTypes< CustomLayers... > layer) |
|
double | Evaluate (const arma::mat ¶meters, const size_t begin, const size_t batchSize, const bool deterministic) |
| Evaluate the bidirectional recurrent neural network with the given parameters. More...
|
|
double | Evaluate (const arma::mat ¶meters, const size_t begin, const size_t batchSize) |
| Evaluate the bidirectional recurrent neural network with the given parameters. More...
|
|
template |
double | EvaluateWithGradient (const arma::mat ¶meters, const size_t begin, GradType &gradient, const size_t batchSize) |
| Evaluate the bidirectional recurrent neural network with the given parameters. More...
|
|
void | Gradient (const arma::mat ¶meters, const size_t begin, arma::mat &gradient, const size_t batchSize) |
| Evaluate the gradient of the bidirectional 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. (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::cube predictors, arma::cube &results, const size_t batchSize=256) |
| Predict the responses to a given set of predictors. More...
|
|
const arma::cube & | Predictors () const |
| Get the matrix of data points (predictors). More...
|
|
arma::cube & | Predictors () |
| Modify the matrix of data points (predictors). More...
|
|
void | Reset () |
| Reset the state of the network. More...
|
|
void | ResetParameters () |
| Reset the module information (weights/parameters). More...
|
|
const arma::cube & | Responses () const |
| Get the matrix of responses to the input data points. More...
|
|
arma::cube & | Responses () |
| Modify the matrix of responses to the input data points. More...
|
|
const size_t & | Rho () const |
| Return the maximum length of backpropagation through time. More...
|
|
size_t & | Rho () |
| Modify the maximum length of backpropagation through time. More...
|
|
template |
void | serialize (Archive &ar, const unsigned int) |
| Serialize the model. More...
|
|
void | Shuffle () |
| Shuffle the order of function visitation. More...
|
|
template |
double | Train (arma::cube predictors, arma::cube responses, OptimizerType &optimizer) |
| Train the bidirectional recurrent neural network on the given input data using the given optimizer. More...
|
|
template |
double | Train (arma::cube predictors, arma::cube responses) |
| Train the bidirectional recurrent neural network on the given input data. More...
|
|
template |
std::enable_if< HasMaxIterations< OptimizerType, size_t &(OptimizerType::*)()>::value, void >::type | WarnMessageMaxIterations (OptimizerType &optimizer, size_t samples) const |
| Check if the optimizer has MaxIterations() parameter, if it does then check if it's value is less than the number of datapoints in the dataset. More...
|
|
template |
std::enable_if< !HasMaxIterations< OptimizerType, size_t &(OptimizerType::*)()>::value, void >::type | WarnMessageMaxIterations (OptimizerType &optimizer, size_t samples) const |
| Check if the optimizer has MaxIterations() parameter, if it doesn't then simply return from the function. More...
|
|
template, typename MergeLayerType = Concat<>, typename MergeOutputType = LogSoftMax<>, typename InitializationRuleType = RandomInitialization, typename... CustomLayers>
class mlpack::ann::BRNN< OutputLayerType, MergeLayerType, MergeOutputType, InitializationRuleType, CustomLayers >
Implementation of a standard bidirectional 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 48 of file brnn.hpp.
double Train |
( |
arma::cube |
predictors, |
|
|
arma::cube |
responses, |
|
|
OptimizerType & |
optimizer |
|
) |
| |
Train the bidirectional 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.
If you want to pass in a parameter and discard the original parameter object, be sure to use std::move to avoid unnecessary copy.
The format of the data should be as follows:
- each slice should correspond to a time step
- each column should correspond to a data point
- each row should correspond to a dimension So, e.g., predictors(i, j, k) is the i'th dimension of the j'th data point at time slice k.
- 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. |
double Train |
( |
arma::cube |
predictors, |
|
|
arma::cube |
responses |
|
) |
| |
Train the bidirectional recurrent neural network on the given input data.
By default, the SGD optimization algorithm is used, but others can be specified (such as ens::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.
If you want to pass in a parameter and discard the original parameter object, be sure to use std::move to avoid unnecessary copy.
The format of the data should be as follows:
- each slice should correspond to a time step
- each column should correspond to a data point
- each row should correspond to a dimension So, e.g., predictors(i, j, k) is the i'th dimension of the j'th data point at time slice k.
- Template Parameters
-
OptimizerType | Type of optimizer to use to train the model. |
- Parameters
-
predictors | Input training variables. |
responses | Outputs results from input training variables. |