Rnn
GenericRNN
Bases: Module
Source code in src/notochord/rnn.py
forward(x, initial_state)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor[batch x time x channel] if batch_first else [time x batch x channel] |
required | |
initial_state |
List[Tensor[layers x batch x hidden]]], list of components |
required |
Returns: hidden: hidden states of top layers Tensor[batch x time x hidden] or [time x batch x hidden] new_states: List[Tensor[layers x batch x hidden]]
Source code in src/notochord/rnn.py
rnn_shim(cls)
LSTM API for GRU and RNN.
hidden state is first element of state tuple