Shortcuts

asteroid.masknn.base module

class asteroid.masknn.base.BaseUNet(encoders, decoders, *, 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] of length N) – List of encoders
  • decoders (List[torch.nn.Module] of length N - 1) – List of decoders
  • output_layer (Optional[torch.nn.Module], optional) – Layer after last decoder.
forward(x)[source]
class asteroid.masknn.base.BaseDCUMaskNet(encoders, decoders, output_layer=None, 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[torch.nn.Module]) – List of encoders
  • decoders (List[torch.nn.Module]) – List of decoders
  • output_layer (Optional[torch.nn.Module], optional) – Layer after last decoder, before mask application.
  • 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).
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, n_src=1, **kwargs)[source]

Create a masknet instance from a predefined, named architecture.

Parameters:
  • architecture (str) – Name of predefined architecture. Valid values are dependent on the concrete subclass of BaseDCUMaskNet.
  • n_src (int, optional) – Number of sources
  • kwargs (optional) – Passed to __init__.
forward(x)[source]
fix_input_dims(x)[source]

Overwrite this in subclasses to implement input dimension checks.

fix_output_dims(y, x)[source]

Overwrite this in subclasses to implement output dimension checks. y is the output and x was the input (passed to use the shape).

Read the Docs v: v0.4.4
Versions
latest
stable
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.5_b
v0.3.4
v0.3.3
v0.3.2
v0.3.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.