espnet2.gan_codec.shared.discriminator.msstft_discriminator.DiscriminatorSTFT
espnet2.gan_codec.shared.discriminator.msstft_discriminator.DiscriminatorSTFT
class espnet2.gan_codec.shared.discriminator.msstft_discriminator.DiscriminatorSTFT(filters: int, in_channels: int = 1, out_channels: int = 1, n_fft: int = 1024, hop_length: int = 256, win_length: int = 1024, max_filters: int = 1024, filters_scale: int = 1, kernel_size: Tuple[int, int] = (3, 9), dilations: List = [1, 2, 4], stride: Tuple[int, int] = (1, 2), normalized: bool = True, norm: str = 'weight_norm', activation: str = 'LeakyReLU', activation_params: dict = {'negative_slope': 0.2})
Bases: Module
STFT sub-discriminator.
- Parameters:
- filters (int) – Number of filters in convolutions.
- in_channels (int) – Number of input channels.
- out_channels (int) – Number of output channels.
- n_fft (int) – Size of FFT for each scale.
- hop_length (int) – Length of hop between STFT windows for each scale.
- kernel_size (tuple of int) – Inner Conv2d kernel sizes.
- stride (tuple of int) – Inner Conv2d strides.
- dilations (list of int) – Inner Conv2d dilation on the time dimension.
- win_length (int) – Window size for each scale.
- normalized (bool) – Whether to normalize by magnitude after stft.
- norm (str) – Normalization method.
- activation (str) – Activation function.
- activation_params (dict) – Parameters to provide to the activation function.
- growth (int) – Growth factor for the filters.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x: Tensor)
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.