Diffusers 文件

AutoencoderOobleck

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

AutoencoderOobleck

Oobleck 變分自編碼器 (VAE) 模型,使用 KL 損失,由 Stability AI 在 Stability-AI/stable-audio-toolsStable Audio Open 中引入。該模型在 🤗 Diffusers 中用於將音訊波形編碼為潛在變數,並將潛在表示解碼為音訊波形。

論文摘要如下:

開放式生成模型對社群至關重要,它們允許進行微調,並在展示新模型時作為基線。然而,目前大多數文字到音訊模型都是私有的,藝術家和研究人員無法在其基礎上進行構建。本文描述了一種使用知識共享資料訓練的新型開放權重文字到音訊模型的架構和訓練過程。我們的評估表明,該模型的效能在各種指標上與最先進的模型具有競爭力。值得注意的是,報告的 FDopenl3 結果(衡量生成作品的真實感)展示了其在 44.1kHz 下合成高質量立體聲的潛力。

AutoencoderOobleck

class diffusers.AutoencoderOobleck

< >

( encoder_hidden_size = 128 downsampling_ratios = [2, 4, 4, 8, 8] channel_multiples = [1, 2, 4, 8, 16] decoder_channels = 128 decoder_input_channels = 64 audio_channels = 2 sampling_rate = 44100 )

引數

  • encoder_hidden_size (int, 可選, 預設為 128) — 編碼器的中間表示維度。
  • downsampling_ratios (List[int], 可選, 預設為 [2, 4, 4, 8, 8]) — 編碼器中的下采樣比率。這些比率以相反的順序用於解碼器中的上取樣。
  • channel_multiples (List[int], 可選, 預設為 [1, 2, 4, 8, 16]) — 用於確定隱藏層隱藏尺寸的倍數。
  • decoder_channels (int, 可選, 預設為 128) — 解碼器的中間表示維度。
  • decoder_input_channels (int, 可選, 預設為 64) — 解碼器的輸入維度。對應於潛在維度。
  • audio_channels (int, 可選, 預設為 2) — 音訊資料中的通道數。單聲道為 1,立體聲為 2。
  • sampling_rate (int, 可選, 預設為 44100) — 音訊波形應以赫茲 (Hz) 表示的取樣率進行數字化。

用於將波形編碼為潛在變數並將潛在表示解碼為波形的自編碼器。首次在 Stable Audio 中引入。

此模型繼承自 ModelMixin。有關所有模型實現的通用方法(如下載或儲存),請參閱超類文件。

包裝器

< >

( *args **kwargs )

包裝器

< >

( *args **kwargs )

disable_slicing

< >

( )

停用切片 VAE 解碼。如果之前啟用了 enable_slicing,此方法將恢復一步計算解碼。

enable_slicing

< >

( )

啟用切片 VAE 解碼。啟用此選項後,VAE 會將輸入張量分片,分步計算解碼。這有助於節省一些記憶體並允許更大的批次大小。

forward

< >

( sample: Tensor sample_posterior: bool = False return_dict: bool = True generator: typing.Optional[torch._C.Generator] = None )

引數

  • sample (torch.Tensor) — 輸入樣本。
  • sample_posterior (bool, 可選, 預設為 False) — 是否從後驗分佈中取樣。
  • return_dict (bool, 可選, 預設為 True) — 是否返回 OobleckDecoderOutput 而不是普通元組。

OobleckDecoderOutput

class diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput

< >

( sample: Tensor )

引數

  • sample (形狀為 (batch_size, audio_channels, sequence_length)torch.Tensor) — 模型最後一層的解碼輸出樣本。

解碼方法的輸出。

OobleckDecoderOutput

class diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput

< >

( sample: Tensor )

引數

  • sample (形狀為 (batch_size, audio_channels, sequence_length)torch.Tensor) — 模型最後一層的解碼輸出樣本。

解碼方法的輸出。

AutoencoderOobleckOutput

class diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput

< >

( latent_dist: OobleckDiagonalGaussianDistribution )

引數

  • latent_dist (OobleckDiagonalGaussianDistribution) — Encoder 的編碼輸出,表示為 OobleckDiagonalGaussianDistribution 的均值和標準差。 OobleckDiagonalGaussianDistribution 允許從分佈中取樣潛在變數。

AutoencoderOobleck 編碼方法的輸出。

< > 在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.