espnet2.gan_codec.shared.discriminator.msmpmb_discriminator.WNConv1d
Less than 1 minute
espnet2.gan_codec.shared.discriminator.msmpmb_discriminator.WNConv1d
espnet2.gan_codec.shared.discriminator.msmpmb_discriminator.WNConv1d(*args, **kwargs)
Create a 1D convolutional layer with weight normalization.
This function wraps the standard nn.Conv1d layer with weight normalization. Optionally, it can also include a Leaky ReLU activation layer.
- Parameters:
- *args – Variable length argument list for the convolution layer.
- **kwargs – Keyword arguments for the convolution layer, including: act (bool): If True, adds a LeakyReLU activation. Default is True.
- Returns: The convolutional layer, possibly wrapped in a Sequential model with activation.
- Return type: nn.Sequential or nn.Conv1d
Examples
>>> conv_layer = WNConv1d(1, 16, kernel_size=3)
>>> print(conv_layer)
Sequential(
(0): Conv1d(1, 16, kernel_size=(3,), stride=(1,), ...)
(1): LeakyReLU(negative_slope=0.1)
)