pytagi.nn.slstm#
Classes#
Smoothing Long Short-Term Memory (LSTM) layer. |
Module Contents#
- class pytagi.nn.slstm.SLSTM(input_size: int, output_size: int, seq_len: int, bias: bool = True, gain_weight: float = 1.0, gain_bias: float = 1.0, init_method: str = 'He')[source]#
Bases:
pytagi.nn.base_layer.BaseLayer
Smoothing Long Short-Term Memory (LSTM) layer.
This layer is a variation of the standard LSTM, incorporating a mechanism for smoothing the hidden- and cell-states. It wraps the C++/CUDA backend cutagi.SLSTM.
Initializes the SLSTM layer.
- Parameters:
input_size (int) – The number of expected features in the input $x$.
output_size (int) – The number of features in the hidden state $h$ (and the output).
seq_len (int) – The maximum sequence length this layer is configured to handle.
bias (bool) – If
True
, use bias weights in the internal linear transformations.gain_weight (float) – A scaling factor applied to the initialized weights.
gain_bias (float) – A scaling factor applied to the initialized bias terms.
init_method (str) – The method used for initializing weights and biases (e.g., ‘He’, ‘Xavier’).