Poplar and PopLibs
popnn::lstm::LstmParams Struct Reference

Structure representing the parameters of the LSTM. More...

#include <Lstm.hpp>

Public Attributes

poplar::Type dataType
 The datatype of the LSTM. More...
 
std::size_t batchSize
 The batch size. More...
 
std::size_t timeSteps
 The number of time steps in the sequence of the LSTM. More...
 
std::vector< std::size_t > layerSizes
 The number of neurons before and after each layer of the LSTM. More...
 
bool outputFullSequence = true
 If true the Lstm function returns the entire sequence of outputs, otherwise it returns just the final output.
 
bool doInputWeightCalc = true
 If this parameter is set to false then the LSTM will skip the calculation of weighted inputs (only useful for benchmarking).
 
bool calcInputGradients = true
 If this parameter is set to false then the LSTM will skip the calculation of the gradients of the inputs.
 
bool preserveFinalState = false
 If this parameter is set to true then the LSTM will preserve the internal state at the last valid timestep for each batch entry when using variable timesteps. More...
 
std::vector< BasicLstmCellUnitcellOrder = getDefaultBasicLstmCellOrder()
 The weights and biases for all of the layers being processed are concatenated in the outermost dimension of the weights and biases tensors. More...
 
NonLinearityType activation = NonLinearityType::TANH
 Activation function.
 
NonLinearityType recurrentActivation = NonLinearityType::SIGMOID
 Recurrent activation function.
 

Detailed Description

Structure representing the parameters of the LSTM.

Member Data Documentation

◆ batchSize

std::size_t popnn::lstm::LstmParams::batchSize

The batch size.

Deprecated:
Use rnn::RnnParams.batchSize instead.

◆ cellOrder

std::vector<BasicLstmCellUnit> popnn::lstm::LstmParams::cellOrder = getDefaultBasicLstmCellOrder()

The weights and biases for all of the layers being processed are concatenated in the outermost dimension of the weights and biases tensors.

This option allows you to specify the order of the gates in that outermost dimension. The default order can be obtained with getDefaultBasicLstmCellOrder().

◆ dataType

poplar::Type popnn::lstm::LstmParams::dataType

The datatype of the LSTM.

Deprecated:
Use rnn::RnnParams.dataType instead.

◆ layerSizes

std::vector<std::size_t> popnn::lstm::LstmParams::layerSizes

The number of neurons before and after each layer of the LSTM.

If the LSTM consists of N layers, then this should be a vector of size N+1. The first element is the input size and each subsequent element is the output size of the LSTM layer.

Deprecated:
Use rnn::RnnParams.layerSizes instead.

◆ preserveFinalState

bool popnn::lstm::LstmParams::preserveFinalState = false

If this parameter is set to true then the LSTM will preserve the internal state at the last valid timestep for each batch entry when using variable timesteps.

This may come with a speed penalty. See RnnParams for information about variable timesteps. Use of this parameter does not affect the retained intermediate results in the case of training.

◆ timeSteps

std::size_t popnn::lstm::LstmParams::timeSteps

The number of time steps in the sequence of the LSTM.

Deprecated:
Use rnn::RnnParams.maxTimeSteps instead.

The documentation for this struct was generated from the following file: