Buckets:
| # AutoencoderKLKVAE | |
| KL損失付きの2次元変分オートエンコーダ(VAE)モデル。 | |
| モデルは、以下のコードスニペットで読み込むことができます。 | |
| ```python | |
| import torch | |
| from diffusers import AutoencoderKLKVAE | |
| vae = AutoencoderKLKVAE.from_pretrained("kandinskylab/KVAE-2D-1.0", subfolder="diffusers", dtype=torch.bfloat16) | |
| ``` | |
| ## AutoencoderKLKVAE[[diffusers.AutoencoderKLKVAE]] | |
| #### diffusers.AutoencoderKLKVAE[[diffusers.AutoencoderKLKVAE]] | |
| ```python | |
| diffusers.AutoencoderKLKVAE(in_channels: int = 3, channels: int = 128, num_enc_blocks: int = 2, num_dec_blocks: int = 2, z_channels: int = 16, double_z: bool = True, ch_mult: typing.Tuple[int, ...] = (1, 2, 4, 8), sample_size: int = 1024) | |
| ``` | |
| [ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_kvae.py#L521) | |
| **パラメータ:** | |
| in_channels (int, *optional*, デフォルトは 3) : 入力画像のチャネル数。 | |
| channels (int, *optional*, デフォルトは 128) : 多解像度ブロックにおけるベースのチャネル数。 | |
| num_enc_blocks (int, *optional*, デフォルトは 2) : エンコーダーのマルチリゾリューション層における Resnet ブロックの数。 | |
| num_dec_blocks (int, *optional*, デフォルトは 2) : デコーダーのマルチリゾリューション層における Resnet ブロックの数。 | |
| z_channels (int, *optional*, デフォルト値は 16) : 潜在空間のチャネル数。 | |
| double_z (`bool`、*任意*、デフォルトは`True`) : エンコーダーの出力チャネル数を2倍にするかどうか。 | |
| ch_mult (`Tuple[int, ...]`、*任意*、デフォルトは`(1, 2, 4, 8)`) : マルチリゾリューションブロックにおけるチャネル乗数です。 | |
| sample_size (`int`、*任意*、デフォルトは`1024`) : サンプル入力サイズ。 | |
| KL損失を用いて画像を潜在変数にエンコードし、潜在表現を画像にデコードするためのVAEモデル。 | |
| このモデルは [ModelMixin](/docs/diffusers/main/ja/api/models/overview#diffusers.ModelMixin) を継承しています。すべてのモデルに実装されている汎用的なメソッド(ダウンロードや保存など)については、スーパークラスのドキュメントを参照してください。 | |
| #### decode[[diffusers.AutoencoderKLKVAE.decode]] | |
| ```python | |
| decode(z: FloatTensor, return_dict: bool = True, generator = None) | |
| ``` | |
| [ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_kvae.py#L642) | |
| **パラメータ:** | |
| z (`torch.Tensor`) : 潜在ベクトルの入力バッチ。 | |
| return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`~models.vae.DecoderOutput`を返すかどうか。 | |
| **戻り値:** `~models.vae.DecoderOutput` または `tuple` | |
| return_dict が True の場合、`~models.vae.DecoderOutput` が返され、それ以外の場合は通常の `tuple` が返されます。 | |
| 画像のバッチをデコードします。 | |
| #### encode[[diffusers.AutoencoderKLKVAE.encode]] | |
| ```python | |
| encode(x: Tensor, return_dict: bool = True) | |
| ``` | |
| [ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_kvae.py#L602) | |
| **パラメータ:** | |
| x (`torch.Tensor`) : 画像の入力バッチ。 | |
| return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`~models.autoencoder_kl.AutoencoderKLOutput`を返すかどうか。 | |
| **戻り値:** | |
| エンコードされた画像の潜在表現。`return_dict`がTrueの場合、`~models.autoencoder_kl.AutoencoderKLOutput`が返され、それ以外の場合は通常の`tuple`が返されます。 | |
| バッチの画像を潜在変数にエンコードします。 | |
| #### forward[[diffusers.AutoencoderKLKVAE.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_kl_kvae.py#L776) | |
| **パラメータ:** | |
| sample (`torch.Tensor`) : 入力サンプル。 | |
| sample_posterior (`bool`、*任意*、デフォルトは`False`) : 事後分布からサンプリングするかどうか。 | |
| return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`DecoderOutput`を返すかどうか。 | |
| generator (`torch.Generator`, *任意*) : サンプリングを決定論的にするための [`torch.Generator`](https://pytorch.org/docs/stable/generated/torch.Generator.html)。 | |
| **戻り値:** `~models.vae.DecoderOutput` または `tuple` | |
| `return_dict` が True の場合、`~models.vae.DecoderOutput` が返され、それ以外の場合は通常の `tuple` が返されます。 | |
| #### tiled_decode[[diffusers.AutoencoderKLKVAE.tiled_decode]] | |
| ```python | |
| tiled_decode(z: Tensor, return_dict: bool = True) | |
| ``` | |
| [ソース](https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/autoencoders/autoencoder_kl_kvae.py#L729) | |
| **パラメータ:** | |
| z (`torch.Tensor`) : 潜在ベクトルの入力バッチ。 | |
| return_dict (`bool`、*任意*、デフォルトは`True`) : プレーンなタプルではなく`~models.vae.DecoderOutput`を返すかどうか。 | |
| **戻り値:** `~models.vae.DecoderOutput` または `tuple` | |
| return_dict が True の場合、`~models.vae.DecoderOutput` が返され、それ以外の場合は通常の `tuple` が返されます。 | |
| タイル化されたデコーダーを使用して、画像のバッチをデコードします。 | |
Xet Storage Details
- Size:
- 5.7 kB
- Xet hash:
- 0571d8a5ea25c490d0bbd200784256cc68dfbf65514fa24c9eb54ccd0f29019b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.