espnet2.gan_svs.visinger2.visinger2_vocoder.VISinger2Discriminator
espnet2.gan_svs.visinger2.visinger2_vocoder.VISinger2Discriminator
class espnet2.gan_svs.visinger2.visinger2_vocoder.VISinger2Discriminator(scales: int = 1, scale_downsample_pooling: str = 'AvgPool1d', scale_downsample_pooling_params: Dict[str, Any] = {'kernel_size': 4, 'padding': 2, 'stride': 2}, scale_discriminator_params: Dict[str, Any] = {'bias': True, 'channels': 128, 'downsample_scales': [2, 2, 4, 4, 1], 'in_channels': 1, 'kernel_sizes': [15, 41, 5, 3], 'max_downsample_channels': 1024, 'max_groups': 16, 'nonlinear_activation': 'LeakyReLU', 'nonlinear_activation_params': {'negative_slope': 0.1}, 'out_channels': 1}, follow_official_norm: bool = True, periods: List[int] = [2, 3, 5, 7, 11], period_discriminator_params: Dict[str, Any] = {'bias': True, 'channels': 32, 'downsample_scales': [3, 3, 3, 3, 1], 'in_channels': 1, 'kernel_sizes': [5, 3], 'max_downsample_channels': 1024, 'nonlinear_activation': 'LeakyReLU', 'nonlinear_activation_params': {'negative_slope': 0.1}, 'out_channels': 1, 'use_spectral_norm': False, 'use_weight_norm': True}, multi_freq_disc_params: Dict[str, Any] = {'divisors': [32, 16, 8, 4, 2, 1, 1], 'domain': 'double', 'hidden_channels': [256, 512, 512], 'hop_length_factors': [4, 8, 16], 'mel_scale': True, 'sample_rate': 22050, 'strides': [1, 2, 1, 2, 1, 2, 1]})
Bases: Module
Discriminator module for VISinger2, including MSD, MPD, and MFD.
- Parameters:
- scales (int) – Number of scales to be used in the multi-scale discriminator.
- scale_downsample_pooling (str) – Type of pooling used for downsampling.
- scale_downsample_pooling_params (Dict *[*str , Any ]) – Parameters for the downsampling pooling layer.
- scale_discriminator_params (Dict *[*str , Any ]) – Parameters for the scale discriminator.
- follow_official_norm (bool) – Whether to follow the official normalization.
- periods (List *[*int ]) – List of periods to be used in the multi-period discriminator.
- period_discriminator_params (Dict *[*str , Any ]) – Parameters for the period discriminator.
- multi_freq_disc_params (Dict *[*str , Any ]) – Parameters for the multi-frequency discriminator.
- use_spectral_norm (bool) – Whether to use spectral normalization or not.
forward(x)
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.