Recurrent Layers#
Classes#
- class Recurrent(idx, shapes, *, batch_norm=False, layers=2, filters=1, dropout=0, mode='gru', activation='ELU', bidirectional=None, **kwargs)[source]#
Bases:
BaseSingleLayerRecurrent layer constructor for either RNN, GRU or LSTM.
- Attributes:
- group
int Layer group, if 0 it will always be used, else it will only be used if its group matches the Networks
- description
str Description of the layer
- layers
Sequential Layers to loop through in the forward pass
- group
- Parameters:
- idx
int Layer number
- shapes
list[list[int]] Shape of the outputs from each layer
- batch_normbool,
Optional If batch normalisation should be used, default = False
- layers
int,Optional Number of stacked recurrent layers, default = 2
- filters
int,Optional Number of output filters, default = 1
- dropout
float,Optional Probability of dropout, requires layers > 1, default = 0
- mode{‘gru’, ‘rnn’, ‘lstm’}
Type of recurrent layer
- activation
str|NoneType,Optional Which activation function to use, if mode is ‘rnn’, ReLU activation will always be used, default = ‘ELU’
- bidirectional{
NoneType, ‘sum’, ‘mean’, ‘concatenate’} If a bidirectional recurrence should be used and method for combining the two directions
- **kwargs
Leftover parameters to pass to base layer for checking
- idx
- extra_repr()[source]#
Displays layer parameters when printing the network
- Returns:
strLayer parameters