espnet2.enh.layers.dprnn.SingleRNN
Less than 1 minute
espnet2.enh.layers.dprnn.SingleRNN
class espnet2.enh.layers.dprnn.SingleRNN(rnn_type, input_size, hidden_size, dropout=0, bidirectional=False)
Bases: Module
Container module for a single RNN layer.
- Parameters:
- rnn_type – string, select from ‘RNN’, ‘LSTM’ and ‘GRU’.
- input_size – int, dimension of the input feature. The input should have shape (batch, seq_len, input_size).
- hidden_size – int, dimension of the hidden state.
- dropout – float, dropout ratio. Default is 0.
- bidirectional – bool, whether the RNN layers are bidirectional. Default is False.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(input, state=None)
Defines the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.