Diffusers documentation

RFD4ProteinaTransformer

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

RFD4ProteinaTransformer

RFD4-Proteína의 denoiser입니다. sampler가 적분하는 두 가지 모달리티, 즉 backbone CA 위치와 토큰별 local latents의 velocities를 준비된 분자 텐서로부터 예측합니다. 입력은 이름이 지정된 텐서와 checkpoint 구성이 내용을 선택하는 conditioning mapping이며, 구조 파싱은 이 클래스의 범위에 포함되지 않습니다.

from diffusers import RFD4ProteinaTransformer

transformer = RFD4ProteinaTransformer.from_pretrained(
    "nvidia/RFD4-Proteina-Diffusers", subfolder="transformer"
)

RFD4ProteinaTransformer

클래스 diffusers.RFD4ProteinaTransformer

< >

( nlayers: int = 14token_dim: int = 768nheads: int = 12dim_cond: int = 256pair_repr_dim: int = 384latent_dim: int = 32token_type_emb_dim: int = 32cath_emb_dim: int = 32t_emb_dim: int = 256seq_sep_dim: int = 64xt_pair_dist_dim: int = 30xt_pair_dist_min: float = 0.1xt_pair_dist_max: float = 3.0feats_seq: tuple = ('xt_bb_ca', 'xt_local_latents', 'token_type', 'sequence_probabilities', 'cond_a37coors_nm', 'cond_a37coors_internal_nm', 'rasa_binned', 'secondary_structure', 'hbond_modernized', 'pistack', 'pication', 'saltbridge', 'hydrophobic', 'metal_coord', 'na_ss_state', 'hotspot', 'atom_charge', 'atomic_element', 'coord_group_seq', 'chirality', 'chain_centroid_xyz')feats_cond_seq: tuple = ('time_emb_bb_ca', 'time_emb_local_latents', 'cath_code', 'recycle_remaining')feats_pair_repr: tuple = ('xt_bb_ca_pair_dists', 'bond_mask', 'bond_order', 'is_aromatic', 'index_group_pair', 'molecule_idx_pair', 'molecule_entity_pair', 'token_bond_path_length', 'canonical_polymer_ordering', 'na_ss_pair')feats_pair_cond: tuple = ('time_emb_bb_ca', 'time_emb_local_latents')update_pair_repr_every_n: int = 2tri_mult_c: int = 256num_sequence_classes: int = 147num_token_types: int = 7recycle_conditioning_dim: int = 1 )

매개변수

  • nlayers (int, 기본값 14) — 트렁크 레이어의 개수입니다.
  • token_dim (int, 기본값 768) — 토큰 표현의 폭입니다.
  • nheads (int, 기본값 12) — 레이어당 어텐션 헤드 수.
  • dim_cond (int, 기본값 256) — 조건 벡터(시간, 재사용 인덱스, CATH 라벨)의 폭
  • pair_repr_dim (int, 기본값 384) — Pair 표현의 폭입니다.
  • latent_dim (int, 기본값 32) — 토큰별 로컬 잠재 변수의 폭입니다.
  • token_type_emb_dim (int, 기본값 32) — 토큰 유형 임베딩의 차원입니다.
  • cath_emb_dim (int, 기본값 32) — 각 CATH 클래스/구조/토폴로지 임베딩의 폭입니다.
  • t_emb_dim (int, 기본값 256) — Sinusoidal 시간 임베딩의 폭입니다.
  • seq_sep_dim (int, 기본값 64) — bond-path-length bin의 개수.
  • xt_pair_dist_dim (int, 기본값 30) — 백본 pair-distance bin의 수.
  • xt_pair_dist_min (float, 기본값 0.1), xt_pair_dist_max (float, 기본값 3.0) — 나노미터 단위 쌍 거리 범위.
  • feats_seq, feats_cond_seq, feats_pair_repr, feats_pair_cond (list[str]) — 토큰, 조건, 쌍, 쌍-조건 입력으로 투영되는 특징의 이름.
  • update_pair_repr_every_n (int, 기본값 2) — 레이어 간 토큰에서 페어 표현이 업데이트되는 주기입니다.
  • tri_mult_c (int, 기본값 256) — 해당 업데이트에서 삼각 곱셈의 숨겨진 폭(hidden width)입니다.
  • num_token_types (int, 기본값 7) — 토큰 유형 어휘의 크기: 단백질, RNA, DNA, 원자화, 미지, 당류 및 비정형 아미노산.
  • recycle_conditioning_dim (int, 기본값 1) — 해당 기능이 feats_cond_seq에 포함된 경우, recycle_remaining 원핫 인코딩의 폭입니다.
  • num_sequence_classes (int, 기본값 147) — 시퀀스 readout가 예측하는 잔기(residue) 어휘의 크기입니다.

페어링된 백본과 로컬-잠재 모달리티를 갖춘 RFD4 속도 디노이저.

모델은 자체 dtype로 실행됩니다: 저정밀도 추론을 위해 dtype=torch.bfloat16로 로드하세요. forward에 전달되는 샘플링 상태는 float32로 유지되며, 특징 임베딩은 float32로 계산된 후 입력 투영에서 캐스팅됩니다.

forward

< >

( bb_ca: Tensorlocal_latents: Tensorbb_ca_time: Tensorlocal_latents_time: Tensorpadding_mask: Tensortoken_type: typing.Optional[torch.Tensor] = Noneatom37_mask: typing.Optional[torch.Tensor] = Noneconditioning: dict[str, typing.Any] | None = Nonerecycle_depth: int = 0attention_kwargs: dict[str, typing.Any] | None = Nonereturn_dict: bool = True ) → RFD4ProteinaTransformerOutput or tuple

매개변수

  • bb_ca (torch.Tensor) — 나노미터 단위의 노이시 백본 좌표 (batch, tokens, 3).
  • local_latents (torch.Tensor) — 노이즈가 포함된 로컬 라텐트 (batch, tokens, latent_dim).
  • bb_ca_time (torch.Tensor) — (batch,) [0, 1] 범위의 backbone 시간.
  • local_latents_time (torch.Tensor) — (batch,) [0, 1] 범위의 local-latent 시간.
  • 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], optional) — The remaining topology and conditioning tensors, under the keys the preprocessor emits. Which of them are read is fixed by the checkpoint’s feats_seq, feats_cond_seq, feats_pair_repr and feats_pair_cond; a key a configured feature asks for but that is absent leaves that feature unconditioned rather than raising.
  • recycle_depth (int, 기본값 0) — trunk 패스 횟수입니다. 0이어도 패스가 한 번 실행됩니다.
  • attention_kwargs (dict, 선택 사항) — 이 호출의 LoRA scale로 scale만 읽습니다.
  • return_dict (bool, 기본값 True) — 타입이 지정된 출력을 반환하거나, None이 아닌 필드의 튜플을 반환합니다.

반환값

RFD4ProteinaTransformerOutput 또는 tuple

Scheduler 통합 전의 Backbone/local-latent 속도와 선택적 sequence/insertion logits입니다.

샘플러를 진행하지 않고 준비된 분자 텐서에서 속도를 예측합니다.

RFD4ProteinaTransformerOutput

class diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput

< >

( backbone: Tensorlocal_latents: typing.Optional[torch.Tensor] = Nonesequence_logits: typing.Optional[torch.Tensor] = Noneinsertion_logits: typing.Optional[torch.Tensor] = None )

매개변수

  • backbone (torch.Tensor) — (batch, tokens, 3) 형태의 Backbone 속도, 단위 시간당 나노미터.
  • local_latents (torch.Tensor) — (batch, tokens, latent_dim) 형태의 Latent velocity.
  • sequence_logits (torch.Tensor, 선택 사항) — (batch, tokens, 147) 모양의 잔류 로짓(residue logits).
  • insertion_logits (torch.Tensor, 선택 사항) — (batch, tokens, tokens) 모양의 삽입 할당 logits입니다.

…

Update on GitHub