HiFiGANVocoder¶
- class torchaudio.prototype.models.HiFiGANVocoder(in_channels: int, upsample_rates: Tuple[int, ...], upsample_initial_channel: int, upsample_kernel_sizes: Tuple[int, ...], resblock_kernel_sizes: Tuple[int, ...], resblock_dilation_sizes: Tuple[Tuple[int, ...], ...], resblock_type: int, lrelu_slope: float)[源代码]¶
已弃用
警告
该类从 2.8 版本开始已弃用。将在 2.9 版本中移除。此弃用是 TorchAudio 向维护阶段过渡的大规模重构工作的一部分。请参阅 https://github.com/pytorch/audio/issues/3902 获取更多信息。
- HiFi GAN 的生成器部分 [Kong 等人, 2020]。
来源: https://github.com/jik876/hifi-gan/blob/4769534d45265d52a904b850da5a622601885777/models.py#L75
- 注意
要构建模型,请使用以下工厂函数之一:
hifigan_vocoder()
,hifigan_vocoder_v1()
,hifigan_vocoder_v2()
,hifigan_vocoder_v3()
。- 参数 (Args)
in_channels (int): 输入特征中的通道数。 upsample_rates (tuple of
int
): 每个上采样层增加时间维度的因子。 upsample_initial_channel (int): 输入特征张量中的通道数。 upsample_kernel_sizes (tuple ofint
): 每个上采样层的卷积核大小。 resblock_kernel_sizes (tuple ofint
): 每个残差块的卷积核大小。 resblock_dilation_sizes (tuple of tuples ofint
): 每个残差块中每个一维卷积层的膨胀大小。对于 resblock 类型 1,内部元组应长度为 3,因为每个层有 3 个卷积。对于 resblock 类型 2,它们应长度为 2。
resblock_type (int, 1 或 2): 确定是使用
ResBlock1
还是ResBlock2
。 lrelu_slope (float): 激活中 Leaky ReLU 的斜率。
方法¶
forward¶
工厂函数¶
已弃用 |
|
已弃用 |
|
已弃用 |
|
已弃用 |