快捷方式

HiFiGANVocoder

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 卷積層的擴張大小。對於殘差塊型別 1,內部元組應具有長度 3,因為每個層中有 3 個卷積。對於殘差塊型別 2,它們應具有長度 2。

  • resblock_type (int, 1 or 2) – 確定將使用 ResBlock1 還是 ResBlock2

  • lrelu_slope (float) – 啟用函式中 leaky ReLU 的斜率。

方法

forward

HiFiGANVocoder.forward(x: 張量) 張量[source]
引數:

x (張量) – 輸入特徵張量,形狀為 (batch_size, num_channels, time_length)

返回:

形狀為 (batch_size, 1, time_length * upsample_rate) 的張量,其中 upsample_rate 是所有層的上取樣率之積。

工廠函式

hifigan_vocoder

構建 HiFi GAN Vocoder [Kong et al., 2020]

hifigan_vocoder_v1

構建具有 V1 架構的 HiFiGAN Vocoder [Kong et al., 2020]

hifigan_vocoder_v2

構建具有 V2 架構的 HiFiGAN Vocoder [Kong et al., 2020]

hifigan_vocoder_v3

構建具有 V3 架構的 HiFiGAN Vocoder [Kong et al., 2020]

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源