本文簡要介紹python語言中 torchaudio.models.WaveRNN
的用法。
用法:
class torchaudio.models.WaveRNN(upsample_scales: List[int], n_classes: int, hop_length: int, n_res_block: int = 10, n_rnn: int = 512, n_fc: int = 512, kernel_size: int = 5, n_freq: int = 128, n_hidden: int = 128, n_output: int = 128)
upsample_scales-上采樣比例列表。
n_classes-輸出類的數量。
hop_length-連續幀開始之間的樣本數。
n_res_block-堆棧中ResBlock 的數量。 (默認:
10
)n_rnn-RNN 層的維度。 (默認:
512
)n_fc-全連接層的維度。 (默認:
512
)kernel_size-第一個 Conv1d 層中的內核大小數。 (默認:
5
)n_freq-頻譜圖中的 bin 數量。 (默認:
128
)n_hidden-resblock 的隱藏維數。 (默認:
128
)n_output-melresnet 的輸出維數。 (默認:
128
)
WaveRNN 模型基於 fatchord 的實現。
最初的實現是在高效的神經音頻合成[7]。波形和頻譜圖的輸入通道必須為 1。
upsample_scales
必須相等hop_length
.- 示例
>>> wavernn = WaveRNN(upsample_scales=[5,5,8], n_classes=512, hop_length=200) >>> waveform, sample_rate = torchaudio.load(file) >>> # waveform shape: (n_batch, n_channel, (n_time - kernel_size + 1) * hop_length) >>> specgram = MelSpectrogram(sample_rate)(waveform) # shape: (n_batch, n_channel, n_freq, n_time) >>> output = wavernn(waveform, specgram) >>> # output shape: (n_batch, n_channel, (n_time - kernel_size + 1) * hop_length, n_classes)
參數:
相關用法
- Python PyTorch Wav2Vec2Bundle用法及代碼示例
- Python PyTorch Wav2Vec2ASRBundle.get_labels用法及代碼示例
- Python PyTorch Wav2Vec2ASRBundle用法及代碼示例
- Python PyTorch WeightedRandomSampler用法及代碼示例
- Python PyTorch WorkerState用法及代碼示例
- Python PyTorch WIDERFace用法及代碼示例
- Python PyTorch Weibull用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
- Python PyTorch cholesky用法及代碼示例
- Python PyTorch vdot用法及代碼示例
- Python PyTorch ELU用法及代碼示例
- Python PyTorch ScaledDotProduct.__init__用法及代碼示例
- Python PyTorch gumbel_softmax用法及代碼示例
- Python PyTorch get_tokenizer用法及代碼示例
- Python PyTorch saved_tensors_hooks用法及代碼示例
- Python PyTorch positive用法及代碼示例
- Python PyTorch renorm用法及代碼示例
- Python PyTorch AvgPool2d用法及代碼示例
- Python PyTorch MaxUnpool3d用法及代碼示例
- Python PyTorch Bernoulli用法及代碼示例
- Python PyTorch Tensor.unflatten用法及代碼示例
- Python PyTorch Sigmoid用法及代碼示例
- Python PyTorch Tensor.register_hook用法及代碼示例
- Python PyTorch ShardedEmbeddingBagCollection.named_parameters用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torchaudio.models.WaveRNN。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。