Buckets:

download
raw
15.5 kB
import"../chunks/DsnmJJEf.js";import{i as D,h as P,C as F,H as t,a as w,D as n,E as q,s as N}from"../chunks/BLbO27j4.js";import{p as O,o as J,s as e,f as M,a as b,b as Z,c as a,d as y,n as s,r as i}from"../chunks/jDjavuwI.js";const W='{"title":"RFD4ProteinaTransformer","local":"rfd4proteinatransformer","sections":[{"title":"RFD4ProteinaTransformer","local":"diffusers.RFD4ProteinaTransformer","sections":[],"depth":2},{"title":"RFD4ProteinaTransformerOutput","local":"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput","sections":[],"depth":2}],"depth":1}';var j=y('<meta name="hf:doc:metadata"/>'),B=y(`<p></p> <!> <!> <p>The denoiser of <a href="../pipelines/rfd4_proteina">RFD4-Proteína</a>. It predicts velocities for the two modalities the
sampler integrates — backbone CA positions and per-token local latents — from prepared molecular tensors. Inputs are
named tensors plus a conditioning mapping whose contents the checkpoint configuration selects; structure parsing is
outside this class.</p> <!> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>RFD4 velocity denoiser with paired backbone and local-latent modalities.</p> <p>The model runs in its own dtype: load it with <code>dtype=torch.bfloat16</code> for reduced-precision inference. The sampling
state passed to <code>forward</code> stays in float32; feature embeddings are computed in float32 and cast at the input
projection.</p> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Predict velocities from prepared molecular tensors without advancing the sampler.</p></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Denoiser predictions before scheduler integration.</p></div> <!> <p></p>`,1);function S(T,v){O(v,!1),J(()=>{new URLSearchParams(window.location.search).get("fw")}),D();var d=B();P("ej7u6w",h=>{var g=j();N(g,"content",W),b(h,g)});var c=e(M(d),2);F(c,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var m=e(c,2);t(m,{title:"RFD4ProteinaTransformer",local:"rfd4proteinatransformer",headingTag:"h1"});var l=e(m,4);w(l,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFJGRDRQcm90ZWluYVRyYW5zZm9ybWVyJTBBJTBBdHJhbnNmb3JtZXIlMjAlM0QlMjBSRkQ0UHJvdGVpbmFUcmFuc2Zvcm1lci5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIybnZpZGlhJTJGUkZENC1Qcm90ZWluYS1EaWZmdXNlcnMlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ0cmFuc2Zvcm1lciUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> RFD4ProteinaTransformer
transformer = RFD4ProteinaTransformer.from_pretrained(
<span class="hljs-string">&quot;nvidia/RFD4-Proteina-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;transformer&quot;</span>
)`,lang:"py",wrap:!1});var _=e(l,2);t(_,{title:"RFD4ProteinaTransformer",local:"diffusers.RFD4ProteinaTransformer",headingTag:"h2"});var o=e(_,2),f=a(o);n(f,{name:"class diffusers.RFD4ProteinaTransformer",anchor:"diffusers.RFD4ProteinaTransformer",source:"https://github.com/huggingface/diffusers/blob/vr_15092/src/diffusers/models/transformers/transformer_rfd4_proteina.py#L906",parameters:[{name:"nlayers",val:": int = 14"},{name:"token_dim",val:": int = 768"},{name:"nheads",val:": int = 12"},{name:"dim_cond",val:": int = 256"},{name:"pair_repr_dim",val:": int = 384"},{name:"latent_dim",val:": int = 32"},{name:"token_type_emb_dim",val:": int = 32"},{name:"cath_emb_dim",val:": int = 32"},{name:"t_emb_dim",val:": int = 256"},{name:"seq_sep_dim",val:": int = 64"},{name:"xt_pair_dist_dim",val:": int = 30"},{name:"xt_pair_dist_min",val:": float = 0.1"},{name:"xt_pair_dist_max",val:": float = 3.0"},{name:"feats_seq",val:": 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')"},{name:"feats_cond_seq",val:": tuple = ('time_emb_bb_ca', 'time_emb_local_latents', 'cath_code', 'recycle_remaining')"},{name:"feats_pair_repr",val:": 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')"},{name:"feats_pair_cond",val:": tuple = ('time_emb_bb_ca', 'time_emb_local_latents')"},{name:"update_pair_repr_every_n",val:": int = 2"},{name:"tri_mult_c",val:": int = 256"},{name:"num_sequence_classes",val:": int = 147"},{name:"num_token_types",val:": int = 7"},{name:"recycle_conditioning_dim",val:": int = 1"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaTransformer.nlayers",description:"<strong>nlayers</strong> (<code>int</code>, defaults to <code>14</code>) &#x2014; Number of trunk layers.",name:"nlayers"},{anchor:"diffusers.RFD4ProteinaTransformer.token_dim",description:"<strong>token_dim</strong> (<code>int</code>, defaults to <code>768</code>) &#x2014; Token representation width.",name:"token_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.nheads",description:"<strong>nheads</strong> (<code>int</code>, defaults to <code>12</code>) &#x2014; Attention heads per layer.",name:"nheads"},{anchor:"diffusers.RFD4ProteinaTransformer.dim_cond",description:"<strong>dim_cond</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014; Width of the conditioning vector (time, recycle index, CATH label).",name:"dim_cond"},{anchor:"diffusers.RFD4ProteinaTransformer.pair_repr_dim",description:"<strong>pair_repr_dim</strong> (<code>int</code>, defaults to <code>384</code>) &#x2014; Pair representation width.",name:"pair_repr_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.latent_dim",description:"<strong>latent_dim</strong> (<code>int</code>, defaults to <code>32</code>) &#x2014; Width of the per-token local latent.",name:"latent_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.token_type_emb_dim",description:"<strong>token_type_emb_dim</strong> (<code>int</code>, defaults to <code>32</code>) &#x2014; Token-type embedding width.",name:"token_type_emb_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.cath_emb_dim",description:"<strong>cath_emb_dim</strong> (<code>int</code>, defaults to <code>32</code>) &#x2014; Width of each CATH class/architecture/topology embedding.",name:"cath_emb_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.t_emb_dim",description:"<strong>t_emb_dim</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014; Sinusoidal time embedding width.",name:"t_emb_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.seq_sep_dim",description:"<strong>seq_sep_dim</strong> (<code>int</code>, defaults to <code>64</code>) &#x2014; Number of bond-path-length bins.",name:"seq_sep_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.xt_pair_dist_dim",description:"<strong>xt_pair_dist_dim</strong> (<code>int</code>, defaults to <code>30</code>) &#x2014; Number of backbone pair-distance bins.",name:"xt_pair_dist_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.xt_pair_dist_min",description:`<strong>xt_pair_dist_min</strong> (<code>float</code>, defaults to <code>0.1</code>), xt_pair_dist_max (<code>float</code>, defaults to <code>3.0</code>) &#x2014;
Pair-distance range in nanometers.`,name:"xt_pair_dist_min"},{anchor:"diffusers.RFD4ProteinaTransformer.feats_seq,",description:`<strong>feats_seq,</strong> feats_cond_seq, feats_pair_repr, feats_pair_cond (<code>list[str]</code>) &#x2014;
Names of the features projected into the token, conditioning, pair and pair-conditioning inputs.`,name:"feats_seq,"},{anchor:"diffusers.RFD4ProteinaTransformer.update_pair_repr_every_n",description:`<strong>update_pair_repr_every_n</strong> (<code>int</code>, defaults to <code>2</code>) &#x2014;
How often the pair representation is updated from the tokens between layers.`,name:"update_pair_repr_every_n"},{anchor:"diffusers.RFD4ProteinaTransformer.tri_mult_c",description:"<strong>tri_mult_c</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014; Hidden width of the triangle multiplication in those updates.",name:"tri_mult_c"},{anchor:"diffusers.RFD4ProteinaTransformer.num_token_types",description:`<strong>num_token_types</strong> (<code>int</code>, defaults to <code>7</code>) &#x2014; Size of the token-type vocabulary: protein, RNA, DNA, atomized,
unknown, glycan and non-canonical amino acid.`,name:"num_token_types"},{anchor:"diffusers.RFD4ProteinaTransformer.recycle_conditioning_dim",description:`<strong>recycle_conditioning_dim</strong> (<code>int</code>, defaults to <code>1</code>) &#x2014; Width of the <code>recycle_remaining</code> one-hot, when that
feature is in <code>feats_cond_seq</code>.`,name:"recycle_conditioning_dim"},{anchor:"diffusers.RFD4ProteinaTransformer.num_sequence_classes",description:"<strong>num_sequence_classes</strong> (<code>int</code>, defaults to <code>147</code>) &#x2014; Size of the residue vocabulary the sequence readout predicts.",name:"num_sequence_classes"}]});var p=e(f,6),k=a(p);n(k,{name:"forward",anchor:"diffusers.RFD4ProteinaTransformer.forward",source:"https://github.com/huggingface/diffusers/blob/vr_15092/src/diffusers/models/transformers/transformer_rfd4_proteina.py#L1062",parameters:[{name:"bb_ca",val:": Tensor"},{name:"local_latents",val:": Tensor"},{name:"bb_ca_time",val:": Tensor"},{name:"local_latents_time",val:": Tensor"},{name:"padding_mask",val:": Tensor"},{name:"token_type",val:": typing.Optional[torch.Tensor] = None"},{name:"atom37_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"conditioning",val:": dict[str, typing.Any] | None = None"},{name:"recycle_depth",val:": int = 0"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaTransformer.forward.bb_ca",description:"<strong>bb_ca</strong> (<code>torch.Tensor</code>) &#x2014; Noisy backbone coordinates <code>(batch, tokens, 3)</code> in nanometers.",name:"bb_ca"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.local_latents",description:"<strong>local_latents</strong> (<code>torch.Tensor</code>) &#x2014; Noisy local latents <code>(batch, tokens, latent_dim)</code>.",name:"local_latents"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.bb_ca_time",description:"<strong>bb_ca_time</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch,)</code> backbone time in [0, 1].",name:"bb_ca_time"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.local_latents_time",description:"<strong>local_latents_time</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch,)</code> local-latent time in [0, 1].",name:"local_latents_time"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.padding_mask",description:"<strong>padding_mask</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens)</code>, true where a token is real rather than padding.",name:"padding_mask"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.token_type",description:"<strong>token_type</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014; <code>(batch, tokens)</code> token-type codes.",name:"token_type"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.atom37_mask",description:"<strong>atom37_mask</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014; <code>(batch, tokens, 37)</code>, true where an atom slot is used.",name:"atom37_mask"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.conditioning",description:`<strong>conditioning</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014; The remaining topology and conditioning tensors,
under the keys the preprocessor emits. Which of them are read is fixed by the checkpoint&#x2019;s <code>feats_seq</code>,
<code>feats_cond_seq</code>, <code>feats_pair_repr</code> and <code>feats_pair_cond</code>; a key a configured feature asks for but that
is absent leaves that feature unconditioned rather than raising.`,name:"conditioning"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.recycle_depth",description:"<strong>recycle_depth</strong> (<code>int</code>, defaults to <code>0</code>) &#x2014; Number of trunk passes; zero still executes one pass.",name:"recycle_depth"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.attention_kwargs",description:"<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014; Only <code>scale</code> is read, as the LoRA scale for this call.",name:"attention_kwargs"},{anchor:"diffusers.RFD4ProteinaTransformer.forward.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Return a typed output, or a tuple of non-None fields.",name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Backbone/local-latent velocities and optional
sequence/insertion logits, before scheduler integration.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>RFD4ProteinaTransformerOutput</code> or <code>tuple</code></p>
`}),s(2),i(p),i(o);var u=e(o,2);t(u,{title:"RFD4ProteinaTransformerOutput",local:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput",headingTag:"h2"});var r=e(u,2),x=a(r);n(x,{name:"class diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput",anchor:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput",source:"https://github.com/huggingface/diffusers/blob/vr_15092/src/diffusers/models/transformers/transformer_rfd4_proteina.py#L890",parameters:[{name:"backbone",val:": Tensor"},{name:"local_latents",val:": typing.Optional[torch.Tensor] = None"},{name:"sequence_logits",val:": typing.Optional[torch.Tensor] = None"},{name:"insertion_logits",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput.backbone",description:"<strong>backbone</strong> (<code>torch.Tensor</code>) &#x2014; Backbone velocity shaped <code>(batch, tokens, 3)</code>, in nanometers per unit time.",name:"backbone"},{anchor:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput.local_latents",description:"<strong>local_latents</strong> (<code>torch.Tensor</code>) &#x2014; Latent velocity shaped <code>(batch, tokens, latent_dim)</code>.",name:"local_latents"},{anchor:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput.sequence_logits",description:"<strong>sequence_logits</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014; Residue logits shaped <code>(batch, tokens, 147)</code>.",name:"sequence_logits"},{anchor:"diffusers.models.transformers.transformer_rfd4_proteina.RFD4ProteinaTransformerOutput.insertion_logits",description:"<strong>insertion_logits</strong> (<code>torch.Tensor</code>, <em>optional</em>) &#x2014; Insertion assignment logits shaped <code>(batch, tokens, tokens)</code>.",name:"insertion_logits"}]}),s(2),i(r);var R=e(r,2);q(R,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/rfd4_proteina_transformer.md"}),s(2),b(T,d),Z()}export{S as component};

Xet Storage Details

Size:
15.5 kB
·
Xet hash:
284e2368221006e9fa4c43491c121b01073c330cfb026d9fc40d5df92e97309c

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