Buckets:

hf-doc-build/doc / diffusers /main /ko /api /models /rfd4_proteina_autoencoder.md
mishig's picture
|
download
raw
10 kB

RFD4ProteinaAutoencoder

RFD4-Proteína의 오토인코더입니다. encode는 atom37 좌표를 토큰별 로컬 잠재 변수로 매핑하고, decode는 잠재 변수와 백본 위치를 다시 atom37 구조와 잔기 신원으로 변환합니다. 파이프라인에서는 vae로 등록됩니다.

from diffusers import RFD4ProteinaAutoencoder

vae = RFD4ProteinaAutoencoder.from_pretrained("nvidia/RFD4-Proteina-Diffusers", subfolder="vae")

RFD4ProteinaAutoencoder[[diffusers.RFD4ProteinaAutoencoder]]

diffusers.RFD4ProteinaAutoencoder[[diffusers.RFD4ProteinaAutoencoder]]

diffusers.RFD4ProteinaAutoencoder(atom37_mask: Sequence, allowed_residue_types: Sequence, latent_dim: int = 32, n_residue_types: int = 147, num_token_types: int = 7, nlayers: int = 12, token_dim: int = 768, nheads: int = 12, dim_cond: int = 128, pair_repr_dim: int = 256, token_type_emb_dim: int = 32, encoder_feats_seq: tuple = ('token_type', 'x1_a37coors_nm', 'x1_a37coors_nm_rel', 'chain_idx_seq', 'incident_bond_type_counts', 'atom37_element_charge_embedding'), decoder_feats_seq: tuple = ('ca_coors_nm', 'z_latent_seq', 'token_type', 'cond_residue_type'))

소스

매개변수:

latent_dim (int, 기본값 32) : 토큰별 로컬 잠재 변수의 폭.

n_residue_types (int, 기본값 147) : 잔기 어휘 크기.

num_token_types (int, 기본값 7) : 토큰 유형 어휘의 크기: 단백질, RNA, DNA, 원자화, 미지, 당류 및 비정형 아미노산.

allowed_residue_types (list[list[bool]]) : 각 토큰 유형이 디코딩할 수 있는 잔류 클래스를 나타내는 (num_token_types, n_residue_types) 테이블.

nlayers (int, 기본값 12) : 인코더와 디코더 각각의 트렁크 레이어 수.

token_dim (int, 기본값 768) : 토큰 표현의 폭입니다.

nheads (int, 기본값 12) : 레이어당 어텐션 헤드 수.

dim_cond (int, 기본값 128) : (사용되지 않는, 0인) 조건 벡터의 너비.

pair_repr_dim (int, 기본값 256) : trunk 레이어를 구성할 때 사용되는 pair width입니다. 공개된 autoencoder는 pair bias를 사용하지 않으므로 이 매개변수는 파라미터를 보유하지 않습니다.

token_type_emb_dim (int, 기본값 32) : 토큰 유형 임베딩 폭.

encoder_feats_seq, decoder_feats_seq (list[str]) : 인코더와 디코더 입력으로 투영된 특징.

atom37_mask (list[list[bool]]) : 각 잔기 유형에 대한 유효한 atom37 슬롯, 모양은 (n_residue_types, 37).

Paired molecular encoder와 atom37 decoder.

이 모델에 공급되고 반환되는 좌표는 나노미터(nm) 단위입니다.

encode[[diffusers.RFD4ProteinaAutoencoder.encode]]

encode(coords_nm: Tensor, padding_mask: Tensor, token_type: typing.Optional[torch.Tensor] = None, atom37_mask: typing.Optional[torch.Tensor] = None, conditioning: dict[str, typing.Any] | None = None, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, return_dict: bool = True)

소스

매개변수:

coords_nm (torch.Tensor) : (batch, tokens, 37, 3) 나노미터 단위 atom37 좌표.

padding_mask (torch.Tensor) : (batch, tokens), 토큰이 패딩이 아닌 실제 토큰인 위치가 true인 값.

token_type (torch.Tensor, 선택 사항) : (batch, tokens) 토큰 유형 코드.

atom37_mask (torch.Tensor, 선택 사항) : (batch, tokens, 37), 원자 슬롯이 사용된 위치에서 true입니다.

conditioning (dict[str, Any], 선택 사항) : preprocessor가 출력하는 키 아래에 있는 나머지 topology 및 conditioning 텐서입니다.

generator (torch.Generator 또는 list[torch.Generator], 선택 사항) : 독립적인 확률적 잠재 샘플을 위해 배치 행별로 하나의 생성기를 사용합니다. 생성기가 없으면 전역 스트림에서 샘플링을 수행합니다.

return_dict (bool, 기본값 True) : 타입이 지정된 출력 또는 해당 필드의 튜플을 반환합니다.

반환값: RFD4ProteinaEncoderOutput 또는 tuple

(batch, tokens, latent_dim) 모양의 Latent, mean, log-scale 텐서.

준비된 좌표와 조건을 샘플링된 토큰별 로컬 잠재 변수로 인코딩합니다.

decode[[diffusers.RFD4ProteinaAutoencoder.decode]]

decode(z_latent: Tensor, ca_coors_nm: Tensor, padding_mask: Tensor, token_type: typing.Optional[torch.Tensor] = None, atom37_mask: typing.Optional[torch.Tensor] = None, conditioning: dict[str, typing.Any] | None = None, return_dict: bool = True)

소스

매개변수:

z_latent (torch.Tensor) : (batch, tokens, latent_dim) 토큰별 로컬 라텐트.

ca_coors_nm (torch.Tensor) : (batch, tokens, 3) 나노미터 단위인 backbone CA 좌표.

padding_mask (torch.Tensor) : (batch, tokens), 토큰이 패딩이 아닌 실제 토큰인 위치가 true인 값.

token_type (torch.Tensor, 선택 사항) : (batch, tokens) 토큰 유형 코드.

atom37_mask (torch.Tensor, 선택 사항) : (batch, tokens, 37), 원자 슬롯이 사용된 위치에서 true입니다.

conditioning (dict[str, Any], 선택 사항) : 전처리자가 출력하는 키 아래에 있는 나머지 토폴로지 및 조건 텐서입니다. 시퀀스 조건은 여기서 읽힙니다.

return_dict (bool, 기본값 True) : 타입이 지정된 출력 또는 해당 필드의 튜플을 반환합니다.

반환값: RFD4ProteinaDecoderOutput 또는 tuple

나노미터 단위의 좌표 (batch, tokens, 37, 3), 잔기 유형 (batch, tokens), 방출 마스크 (batch, tokens) 및 원자 마스크 (batch, tokens, 37)입니다. 방출되지 않은 원자의 좌표는 0입니다.

토큰별 잠재 변수(latents)와 백본(backbone) 위치를 atom37 구조로 디코딩합니다.

forward[[diffusers.RFD4ProteinaAutoencoder.forward]]

forward(z_latent: Tensor, ca_coors_nm: Tensor, padding_mask: Tensor, token_type: typing.Optional[torch.Tensor] = None, atom37_mask: typing.Optional[torch.Tensor] = None, conditioning: dict[str, typing.Any] | None = None, return_dict: bool = True)

소스

매개변수:

z_latent (torch.Tensor) : (batch, tokens, latent_dim) 토큰별 로컬 라텐트.

ca_coors_nm (torch.Tensor) : (batch, tokens, 3) 나노미터 단위인 backbone CA 좌표.

padding_mask (torch.Tensor) : (batch, tokens), 토큰이 패딩이 아닌 실제 토큰인 위치가 true인 값.

token_type (torch.Tensor, 선택 사항) : (batch, tokens) 토큰 유형 코드.

atom37_mask (torch.Tensor, 선택 사항) : (batch, tokens, 37), 원자 슬롯이 사용된 위치에서 true입니다.

conditioning (dict[str, Any], 선택 사항) : 나머지 토폴로지 및 조건 텐서입니다.

return_dict (bool, 기본값 True) : 타입이 지정된 출력 또는 해당 필드의 튜플을 반환합니다.

반환값: RFD4ProteinaDecoderOutput 또는 tuple

디코딩된 좌표, 잔기 유형 및 원자/발생 마스크.

토큰별 latents와 backbone 위치를 디코딩합니다. decode()를 호출하는 것과 동일합니다.

RFD4ProteinaEncoderOutput[[diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput]]

diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput[[diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput]]

diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput(latent: Tensor, mean: typing.Optional[torch.Tensor] = None, log_scale: typing.Optional[torch.Tensor] = None)

소스

매개변수:

latent (torch.Tensor) : mean + noise * exp(log_scale)을 샘플링하며, 출력된 잠재 토큰 외부의 값은 0입니다.

mean (torch.Tensor) : 가우시안 평균, 출력된 잠재 토큰 바깥쪽은 0.

log_scale (torch.Tensor) : 로그 표준 편차. 출력된 잠재 토큰 외부의 값은 0입니다.

각각 (batch, tokens, latent_dim) 모양인 샘플링된 잠재 변수와 가우시안 매개변수입니다.

RFD4ProteinaDecoderOutput[[diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput]]

diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput[[diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput]]

diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput(coordinates: Tensor, residue_type: typing.Optional[torch.Tensor] = None, emit_mask: typing.Optional[torch.Tensor] = None, atom_mask: typing.Optional[torch.Tensor] = None)

소스

매개변수:

coordinates (torch.Tensor) : 나노미터 단위의 좌표 (batch, tokens, 37, 3); 출력되지 않는 원자는 0입니다.

residue_type (torch.Tensor) : (batch, tokens) 모양의 잔류 어휘 인덱스.

emit_mask (torch.Tensor) : (batch, tokens) 모양의 Boolean emitted-token mask.

atom_mask (torch.Tensor) : (batch, tokens, 37) 모양의 Boolean 유효 원자 마스크.

디코딩된 분자 좌표 및 이산 atom37 위상.

Xet Storage Details

Size:
10 kB
·
Xet hash:
422e980256a63c42e970139684255113e22be7aee301d15c9ae2074b2b83bf79

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