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)[source]¶
HiFi GAN [Kong et al., 2020] 的生成器部分。來源:https://github.com/jik876/hifi-gan/blob/4769534d45265d52a904b850da5a622601885777/models.py#L75
注意
若要建置模型,請使用下列其中一個工廠函數:
hifigan_vocoder()
、hifigan_vocoder_v1()
、hifigan_vocoder_v2()
、hifigan_vocoder_v3()
。- 參數:
in_channels (int) – 輸入特徵中的通道數量。
upsample_rates (tuple of
int
) – 每個升採樣層增加時間維度的倍數。upsample_initial_channel (int) – 輸入特徵張量中的通道數量。
upsample_kernel_sizes (tuple of
int
) – 每個升採樣層的核心大小。resblock_kernel_sizes (tuple of
int
) – 每個殘差區塊的核心大小。resblock_dilation_sizes (tuple of tuples of
int
) – 每個殘差區塊中每個 1D 卷積層的擴張大小。對於 resblock type 1,內部元組的長度應為 3,因為每層中有 3 個卷積。對於 resblock type 2,它們的長度應為 2。resblock_type (int, 1 或 2) – 決定將使用
ResBlock1
還是ResBlock2
。lrelu_slope (float) – 啟動函數中 leaky ReLU 的斜率。
方法¶
forward¶
工廠函數¶
建置 HiFi GAN Vocoder [Kong et al., 2020]。 |
|
建置具有 V1 架構的 HiFiGAN Vocoder [Kong et al., 2020]。 |
|
建置具有 V2 架構的 HiFiGAN Vocoder [Kong et al., 2020]。 |
|
建置具有 V3 架構的 HiFiGAN Vocoder [Kong et al., 2020]。 |