Buckets:

hf-doc-build/doc / diffusers /main /ja /api /models /autoencoder_oobleck.md
mishig's picture
|
download
raw
7.88 kB
# AutoencoderOobleck
KL損失付きのOobleck変分オートエンコーダー(VAE)モデルは、Stability AIの[Stability-AI/stable-audio-tools](https://github.com/Stability-AI/stable-audio-tools)および[Stable Audio Open](https://huggingface.co/papers/2407.14358)で導入されました。このモデルは、🤗 Diffusersにおいて、オーディオ波形を潜在変数にエンコードし、潜在表現をオーディオ波形にデコードするために使用されます。
論文の抄録は以下の通りです:
*オープンな生成モデルはコミュニティにとって極めて重要であり、ファインチューニングを可能にし、新しいモデルを提示する際のベースラインとして機能します。しかし、現在のテキストからオーディオを生成するモデルの多くは非公開であり、アーティストや研究者がその上に構築することができません。ここでは、クリエイティブ・コモンズデータで学習された新しいオープンウェイトのテキストからオーディオを生成するモデルのアーキテクチャと学習プロセスについて説明します。評価の結果、このモデルの性能は、さまざまな指標において最先端のモデルと競合できることが示されました。特に、FDopenl3の結果(生成物のリアリズムを測定する指標)は、44.1kHzでの高品質ステレオサウンド合成におけるその可能性を示しています。*
## AutoencoderOobleck[[diffusers.AutoencoderOobleck]]
#### diffusers.AutoencoderOobleck[[diffusers.AutoencoderOobleck]]
```python
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)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L294)
**パラメータ:**
encoder_hidden_size (`int`、*任意*、デフォルトは 128) : エンコーダーの中間表現次元数。
downsampling_ratios (`list[int]`、*任意*、デフォルトは`[2, 4, 4, 8, 8]`) : エンコーダーにおけるダウンサンプリングの比率です。デコーダーにおけるアップサンプリングには、これらの比率を逆順で使用します。
channel_multiples (`list[int]`、*optional*、デフォルトは`[1, 2, 4, 8, 16]`) : 隠れ層のサイズを決定するために使用される倍数です。
decoder_channels (`int`、*任意*、デフォルトは 128) : デコーダーの中間表現次元数。
decoder_input_channels (`int`、*optional*、デフォルトは 64) : デコーダーの入力次元。潜在次元に対応します。
audio_channels (`int`、*optional*、デフォルトは 2) : 音声データのチャネル数。モノラルの場合は 1、ステレオの場合は 2 を指定します。
sampling_rate (`int`、*optional*、デフォルトは 44100) : 音声波形をデジタル化するためのサンプリングレート (Hz)。
波形を潜在変数にエンコードし、潜在表現を波形にデコードするためのオートエンコーダーです。Stable Audio で初めて導入されました。
このモデルは [ModelMixin](/docs/diffusers/main/ja/api/models/overview#diffusers.ModelMixin) を継承しています。すべてのモデルに実装されている汎用的なメソッド(ダウンロードや保存など)については、スーパークラスのドキュメントを参照してください。
#### decode[[diffusers.AutoencoderOobleck.decode]]
```python
decode(z: FloatTensor, return_dict: bool = True, generator = None)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L488)
**パラメータ:**
z (`torch.Tensor`) : 潜在ベクトルの入力バッチ。
return_dict (`bool`、*任意*、デフォルトは`True`) : 通常のタプルではなく`~models.vae.OobleckDecoderOutput`を返すかどうか。
**戻り値:** `~models.vae.OobleckDecoderOutput` または `tuple`
If return_dict is True, a `~models.vae.OobleckDecoderOutput` is returned, otherwise a plain `tuple` is returned.
画像のバッチをデコードします。
#### encode[[diffusers.AutoencoderOobleck.encode]]
```python
encode(x: Tensor, return_dict: bool = True)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L377)
**パラメータ:**
x (`torch.Tensor`) : 画像の入力バッチ。
return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`~models.autoencoder_kl.AutoencoderKLOutput`を返すかどうか。
**戻り値:**
エンコードされた画像の潜在表現。`return_dict`がTrueの場合、`~models.autoencoder_kl.AutoencoderKLOutput`が返され、それ以外の場合は通常の`tuple`が返されます。
バッチの画像を潜在変数にエンコードします。
#### forward[[diffusers.AutoencoderOobleck.forward]]
```python
forward(sample: Tensor, sample_posterior: bool = False, return_dict: bool = True, generator: typing.Optional[torch.Generator] = None)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L517)
**パラメータ:**
sample (`torch.Tensor`) : 入力サンプル。
sample_posterior (`bool`、*任意*、デフォルトは`False`) : 事後分布からサンプリングするかどうか。
return_dict (`bool`, *任意*, デフォルトは `True`) : プレーンなタプルではなく `OobleckDecoderOutput` を返すかどうか。
generator (`torch.Generator`, *任意*) : サンプリングを決定論的にするための [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html)。
**戻り値:** `~models.vae.OobleckDecoderOutput` または `tuple`
`return_dict` が True の場合、`~models.vae.OobleckDecoderOutput` が返され、それ以外の場合は通常の `tuple` が返されます。
## OobleckDecoderOutput[[diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput]]
#### diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput[[diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput]]
```python
diffusers.models.autoencoders.autoencoder_oobleck.OobleckDecoderOutput(sample: Tensor)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L202)
**パラメータ:**
sample (`torch.Tensor`、形状 `(batch_size, audio_channels, sequence_length)`) : モデルの最終層からのデコード済み出力サンプル。
デコードメソッドの出力。
## AutoencoderOobleckOutput[[diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput]]
#### diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput[[diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput]]
```python
diffusers.models.autoencoders.autoencoder_oobleck.AutoencoderOobleckOutput(latent_dist: OobleckDiagonalGaussianDistribution)
```
[ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_oobleck.py#L187)
**パラメータ:**
latent_dist (`OobleckDiagonalGaussianDistribution`) : `Encoder`のエンコード済み出力を、`OobleckDiagonalGaussianDistribution`の平均と標準偏差として表したものです。`OobleckDiagonalGaussianDistribution`を使用すると、この分布から潜在変数をサンプリングできます。
AutoencoderOobleck のエンコードメソッドの出力。

Xet Storage Details

Size:
7.88 kB
·
Xet hash:
217a354eb1a9324ea417e183f42ce5d2a5a50fbcb5436a39bcc9b4ce340710fd

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.