Diffusers documentation
AutoencoderKLKVAEVideo
AutoencoderKLKVAEVideo
KL 손실을 사용하는 3D 변분 오토인코더(VAE) 모델.
다음 코드 스니펫으로 모델을 로드할 수 있습니다.
import torch
from diffusers import AutoencoderKLKVAEVideo
vae = AutoencoderKLKVAEVideo.from_pretrained("kandinskylab/KVAE-3D-1.0", subfolder="diffusers", dtype=torch.float16)AutoencoderKLKVAEVideo
class diffusers.AutoencoderKLKVAEVideo
< source >( ch: int = 128ch_mult: typing.Tuple[int, ...] = (1, 2, 4, 8)num_res_blocks: int = 2in_channels: int = 3out_ch: int = 3z_channels: int = 16temporal_compress_times: int = 4 )
매개변수
- ch (
int, 선택 사항, 기본값 128) — 기본 채널 수. - ch_mult (
Tuple[int], 선택 사항, 기본값(1, 2, 4, 8)) — 레벨별 채널 배율. - num_res_blocks (
int, 선택 사항, 기본값 2) — 레벨당 잔차 블록의 수. - in_channels (
int, 선택 사항, 기본값 3) — 입력 채널 수. - out_ch (
int, 선택 사항, 기본값 3) — 출력 채널 수. - z_channels (
int, 선택 사항, 기본값 16) — 잠재 채널의 수. - temporal_compress_times (
int, 선택 사항, 기본값 4) — 시간 압축 계수.
KL 손실을 사용하여 비디오를 잠재 변수로 인코딩하고 잠재 표현을 비디오로 디코딩하는 VAE 모델입니다. KVAE에서 사용됩니다.
이 모델은 ModelMixin에서 상속됩니다. 모든 모델에 대해 구현된 일반적 메서드(다운로드 또는 저장 등)에 대해서는 상위 클래스 문서를 확인하세요.
decode
< source >( z: Tensorreturn_dict: bool = True ) → ~models.vae.DecoderOutput or tuple
videos 배치의 디코딩을 수행합니다.
슬라이스된 VAE 디코딩을 비활성화합니다.
슬라이스 VAE 디코딩을 활성화합니다.
encode
< source >( x: Tensorreturn_dict: bool = True )
…
forward
< source >( sample: Tensorsample_posterior: bool = Falsereturn_dict: bool = Truegenerator: typing.Optional[torch.Generator] = None ) → ~models.vae.DecoderOutput or tuple
매개변수
- sample (
torch.Tensor) — 입력 샘플. - sample_posterior (
bool, 선택 사항, 기본값False) — 후분포에서 샘플링할지 여부. - return_dict (
bool, 선택 사항, 기본값True) — 일반 튜플 대신DecoderOutput를 반환할지 여부. - generator (
torch.Generator, 선택 사항) — 샘플링을 결정적으로 만들기 위한torch.Generator.
반환값
~models.vae.DecoderOutput 또는 tuple
return_dict가 True이면 ~models.vae.DecoderOutput가 반환되고, 그렇지 않으면 일반 tuple이 반환됩니다.