espnet2.gan_codec.encodec.encodec.EncodecDiscriminator
espnet2.gan_codec.encodec.encodec.EncodecDiscriminator
class espnet2.gan_codec.encodec.encodec.EncodecDiscriminator(msstft_discriminator_params: Dict[str, Any] = {'activation': 'LeakyReLU', 'activation_params': {'negative_slope: 0.3'}, 'filters': 32, 'hop_lengths': [256, 512, 128, 64, 32], 'in_channels': 1, 'n_fft': [1024, 2048, 512, 256, 128], 'norm': 'weight_norm', 'out_channels': 1, 'win_lengths': [1024, 2048, 512, 256, 128]})
Bases: Module
Encodec Discriminator with only Multi-Scale STFT discriminator module
Initialize Encodec Discriminator module.
Args: msstft_discriminator_params (Dict[str, Any]) with following arguments: : in_channels (int): Number of input channels. out_channels (int): Number of output channels. filters (int): Number of filters in convolutions. norm (str): normalization choice of Convolutional layers n_ffts (Sequence[int]): Size of FFT for each scale. hop_lengths (Sequence[int]): Length of hop between STFT windows for <br/>
each scale. <br/> win_lengths (Sequence[int]): Window size for each scale. activation (str): activation function choice of convolutional layer activation_params (Dict[str, Any]): parameters for activation function)
forward(x: Tensor) → List[List[Tensor]]
Calculate forward propagation.
- Parameters:x (Tensor) – Input noise signal (B, 1, T).
- Returns: List of list of each discriminator outputs, : which consists of each layer output tensors. Only one discriminator here, but still make it as List of List for consistency.
- Return type: List[List[Tensor]]