inox.nn.recurrent#
Recurrent layers
Classes#
Descriptions#
- class inox.nn.recurrent.Cell(**kwargs)#
Abstract cell class.
A cell defines a recurrence function \(f\) of the form
\[(h_i, y_i) = f(h_{i-1}, x_i)\]and an initial hidden state \(h_0\).
Warning
The recurrence function \(f\) should have no side effects.
- __call__(h, x)#
- class inox.nn.recurrent.Recurrent(cell, reverse=False)#
Creates a recurrent layer.
- Parameters:
- class inox.nn.recurrent.GRUCell(in_features, hid_features, bias=True, key=None)#
Creates a gated recurrent unit (GRU) cell.
References
Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation (Cho et al., 2014)- Parameters:
in_features (int) – The number of input features \(C\).
hid_features (int) – The number of hidden features \(H\).
bias (bool) – Whether the cell learns additive biases or not.
key (Array) – A PRNG key for initialization. If
None
,inox.random.get_rng
is used instead.
- __call__(h, x)#
- class inox.nn.recurrent.LSTMCell(in_features, hid_features, bias=True, key=None)#
Creates a long short-term memory (LSTM) cell.
References
Long Short-Term Memory (Hochreiter et al., 1997)- Parameters:
in_features (int) – The number of input features \(C\).
hid_features (int) – The number of hidden features \(H\).
bias (bool) – Whether the cell learns additive biases or not.
key (Array) – A PRNG key for initialization. If
None
,inox.random.get_rng
is used instead.
- __call__(hc, x)#