espnet2.enh.layers.skim.MemLSTM
espnet2.enh.layers.skim.MemLSTM
class espnet2.enh.layers.skim.MemLSTM(hidden_size, dropout=0.0, bidirectional=False, mem_type='hc', norm_type='cLN')
Bases: Module
the Mem-LSTM of SkiM
- Parameters:
- hidden_size – int, dimension of the hidden state.
- dropout – float, dropout ratio. Default is 0.
- bidirectional – bool, whether the LSTM layers are bidirectional. Default is False.
- mem_type – ‘hc’, ‘h’, ‘c’ or ‘id’. It controls whether the hidden (or cell) state of SegLSTM will be processed by MemLSTM. In ‘id’ mode, both the hidden and cell states will be identically returned.
- norm_type – gLN, cLN. cLN is for causal implementation.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
extra_repr() → str
Set the extra representation of the module
To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.
forward(hc, S)
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.
forward_one_step(hc, state)