espnet2.gan_tts.style_melgan.style_melgan.StyleMelGANDiscriminator
espnet2.gan_tts.style_melgan.style_melgan.StyleMelGANDiscriminator
class espnet2.gan_tts.style_melgan.style_melgan.StyleMelGANDiscriminator(repeats: int = 2, window_sizes: List[int] = [512, 1024, 2048, 4096], pqmf_params: List[List[int]] = [[1, None, None, None], [2, 62, 0.267, 9.0], [4, 62, 0.142, 9.0], [8, 62, 0.07949, 9.0]], discriminator_params: Dict[str, Any] = {'bias': True, 'channels': 16, 'downsample_scales': [4, 4, 4, 1], 'kernel_sizes': [5, 3], 'max_downsample_channels': 512, 'nonlinear_activation': 'LeakyReLU', 'nonlinear_activation_params': {'negative_slope': 0.2}, 'out_channels': 1, 'pad': 'ReflectionPad1d', 'pad_params': {}}, use_weight_norm: bool = True)
Bases: Module
Style MelGAN disciminator module.
Initilize StyleMelGANDiscriminator module.
- Parameters:
- repeats (int) – Number of repititons to apply RWD.
- window_sizes (List *[*int ]) – List of random window sizes.
- pqmf_params (List *[*List *[*int ] ]) – List of list of Parameters for PQMF modules
- discriminator_params (Dict *[*str , Any ]) – Parameters for base discriminator module.
- use_weight_nom (bool) – Whether to apply weight normalization.
apply_weight_norm()
Apply weight normalization module from all of the layers.
forward(x: Tensor) → List[Tensor]
Calculate forward propagation.
- Parameters:x (Tensor) – Input tensor (B, 1, T).
- Returns: List of discriminator outputs, #items in the list will be : equal to repeats * #discriminators.
- Return type: List
reset_parameters()
Reset parameters.