espnet2.enh.layers.skim.SkiM
Less than 1 minute
espnet2.enh.layers.skim.SkiM
class espnet2.enh.layers.skim.SkiM(input_size, hidden_size, output_size, dropout=0.0, num_blocks=2, segment_size=20, bidirectional=True, mem_type='hc', norm_type='gLN', seg_overlap=False)
Bases: Module
Skipping Memory Net
- Parameters:
- input_size – int, dimension of the input feature. Input shape shoud be (batch, length, input_size)
- hidden_size – int, dimension of the hidden state.
- output_size – int, dimension of the output size.
- dropout – float, dropout ratio. Default is 0.
- num_blocks – number of basic SkiM blocks
- segment_size – segmentation size for splitting long features
- bidirectional – bool, whether the RNN layers are bidirectional.
- mem_type – ‘hc’, ‘h’, ‘c’, ‘id’ or None. 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. When mem_type is None, the MemLSTM will be removed.
- norm_type – gLN, cLN. cLN is for causal implementation.
- seg_overlap – Bool, whether the segmentation will reserve 50% overlap for adjacent segments.Default is False.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(input)
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_stream(input_frame, states)