emloop_tensorflow.models.rnn

Functions

  • rnn_stack(): Build a recurrent neural network stack from the given stack_config (sequence of block codes).
emloop_tensorflow.models.rnn.rnn_stack(x, stack_config, sequence_length=None)[source]

Build a recurrent neural network stack from the given stack_config (sequence of block codes).

At the moment, the following blocks are recognized:

  code example
Vanilla RNN [bi]RNN(num_units) biRNN64, RNN128
GRU [bi]GRU(num_units) biGRU32, GRU64
LSTM [bi]LSTM(num_units) biLSTM32, LSTM64

References:

Parameters:
  • x (Tensor) – 3-dim batch-major input tensor [batch, max_time, features]
  • stack_config (Sequence[str]) – a sequence of RNN layer codes defining the stack architecture
  • sequence_length (Optional[Tensor]) – optional tensor with sequence lengths for better performance
Return type:

Tensor

Returns:

3-dim batch-major output of the rnn stack

Raises:

Variables

emloop_tensorflow.models.rnn.RNN_BLOCKS

RNN blocks recognized by the functions in the rnn module.

[<class 'emloop_tensorflow.models.rnn_blocks.RNNBlock'>]