espnet2.enh.layers.tcndenseunet.DenseBlock
Less than 1 minute
espnet2.enh.layers.tcndenseunet.DenseBlock
class espnet2.enh.layers.tcndenseunet.DenseBlock(in_channels, out_channels, num_freqs, pre_blocks=2, freq_proc_blocks=1, post_blocks=2, ksz=(3, 3), activation=<class 'torch.nn.modules.activation.ELU'>, hid_chans=32)
Bases: Module
single DenseNet block as used in iNeuBe model.
- Parameters:
- in_channels – number of input channels (image axis).
- out_channels – number of output channels (image axis).
- num_freqs – number of complex frequencies in the input STFT complex image-like tensor. The input is batch, image_channels, frames, freqs.
- pre_blocks – dense block before point-wise convolution block over frequency axis.
- freq_proc_blocks – number of frequency axis processing blocks.
- post_blocks – dense block after point-wise convolution block over frequency axis.
- ksz – kernel size used in densenet Conv2D layers.
- activation – activation function to use in the whole iNeuBe model, you can use any torch supported activation e.g. ‘relu’ or ‘elu’.
- hid_chans – number of hidden channels in densenet Conv2D.
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.