asteroid.masknn.base module¶
-
class
asteroid.masknn.base.
BaseDCUMaskNet
(encoders, decoders, mask_bound='tanh', **kwargs)[source]¶ Bases:
asteroid.masknn.base.BaseUNet
Base class for DCU-style mask nets. Used for DCUMaskNet and DCCRMaskNet.
The preferred way to instantiate this class is to use the
default_architecture()
classmethod.Parameters: - encoders (list of length N of tuples of (in_chan, out_chan, kernel_size, stride, padding)) – Arguments of encoders of the u-net
- decoders (list of length N of tuples of (in_chan, out_chan, kernel_size, stride, padding)) – Arguments of decoders of the u-net
- mask_bound (Optional[str], optional) – Type of mask bound to use, as defined in [1]. Valid values are “tanh” (“BDT mask”), “sigmoid” (“BDSS mask”), None (unbounded mask).
Input shape is expected to be [batch, n_freqs, time], with n_freqs - 1 divisible by f_0 * f_1 * … * f_N where f_k are the frequency strides of the encoders.
References
[1] : “Phase-aware Speech Enhancement with Deep Complex U-Net”, Hyeong-Seok Choi et al. https://arxiv.org/abs/1903.03107
-
classmethod
default_architecture
(architecture: str, **kwargs)[source]¶ Create a masknet instance from a predefined, named architecture.
Parameters:
-
decoders_stride_product
¶
-
encoders_stride_product
¶
-
class
asteroid.masknn.base.
BaseUNet
(encoders, decoders, *, intermediate_layer=None, output_layer=None)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Base class for u-nets with skip connections between encoders and decoders.
(For u-nets without skip connections, simply use a nn.Sequential.)
Parameters: - encoders (List[torch.nn.Module]) – List of encoders
- decoders (List[torch.nn.Module]) – List of decoders
- intermediate_layer (Optional[torch.nn.Module], optional) – Layer between last encoder and first decoder.
- output_layer (Optional[torch.nn.Module], optional) – Layer after last decoder.