Buckets:

download
raw
19.2 kB
import"../chunks/DsnmJJEf.js";import{i as z,h as J,C as E,H as a,a as G,D as o,E as q,s as V}from"../chunks/BLbO27j4.js";import{p as Z,o as L,s as e,f as C,a as D,b as U,c as t,d as R,n,r}from"../chunks/jDjavuwI.js";const S='{"title":"RFD4ProteinaAutoencoder","local":"rfd4proteinaautoencoder","sections":[{"title":"RFD4ProteinaAutoencoder","local":"diffusers.RFD4ProteinaAutoencoder","sections":[],"depth":2},{"title":"RFD4ProteinaEncoderOutput","local":"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput","sections":[],"depth":2},{"title":"RFD4ProteinaDecoderOutput","local":"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput","sections":[],"depth":2}],"depth":1}';var B=R('<meta name="hf:doc:metadata"/>'),I=R(`<p></p> <!> <!> <p>The autoencoder of <a href="../pipelines/rfd4_proteina">RFD4-Proteína</a>. <code>encode</code> maps atom37 coordinates to per-token local
latents, and <code>decode</code> turns latents and backbone positions back into atom37 structure and residue identities. It is
registered in the pipeline as <code>vae</code>.</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>Paired molecular encoder and atom37 decoder.</p> <p>Coordinates supplied to and returned by this model are in nanometers.</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>Encode prepared coordinates and conditioning into sampled per-token local latents.</p></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>Decode per-token latents and backbone positions into atom37 structure.</p></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>Decode per-token latents and backbone positions; equivalent to calling <a href="/docs/diffusers/pr_15148/en/api/models/rfd4_proteina_autoencoder#diffusers.RFD4ProteinaAutoencoder.decode">decode()</a>.</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>Sampled latent and Gaussian parameters, each shaped <code>(batch, tokens, latent_dim)</code>.</p></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>Decoded molecular coordinates and discrete atom37 topology.</p></div> <!> <p></p>`,1);function Q(F,T){Z(T,!1),L(()=>{new URLSearchParams(window.location.search).get("fw")}),z();var u=I();J("kvugja",b=>{var v=B();V(v,"content",S),D(b,v)});var m=e(C(u),2);E(m,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var l=e(m,2);a(l,{title:"RFD4ProteinaAutoencoder",local:"rfd4proteinaautoencoder",headingTag:"h1"});var _=e(l,4);G(_,{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFJGRDRQcm90ZWluYUF1dG9lbmNvZGVyJTBBJTBBdmFlJTIwJTNEJTIwUkZENFByb3RlaW5hQXV0b2VuY29kZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm52aWRpYSUyRlJGRDQtUHJvdGVpbmEtRGlmZnVzZXJzJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIydmFlJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> RFD4ProteinaAutoencoder
vae = RFD4ProteinaAutoencoder.from_pretrained(<span class="hljs-string">&quot;nvidia/RFD4-Proteina-Diffusers&quot;</span>, subfolder=<span class="hljs-string">&quot;vae&quot;</span>)`,lang:"py",wrap:!1});var f=e(_,2);a(f,{title:"RFD4ProteinaAutoencoder",local:"diffusers.RFD4ProteinaAutoencoder",headingTag:"h2"});var d=e(f,2),h=t(d);o(h,{name:"class diffusers.RFD4ProteinaAutoencoder",anchor:"diffusers.RFD4ProteinaAutoencoder",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L500",parameters:[{name:"atom37_mask",val:": Sequence"},{name:"allowed_residue_types",val:": Sequence"},{name:"latent_dim",val:": int = 32"},{name:"n_residue_types",val:": int = 147"},{name:"num_token_types",val:": int = 7"},{name:"nlayers",val:": int = 12"},{name:"token_dim",val:": int = 768"},{name:"nheads",val:": int = 12"},{name:"dim_cond",val:": int = 128"},{name:"pair_repr_dim",val:": int = 256"},{name:"token_type_emb_dim",val:": int = 32"},{name:"encoder_feats_seq",val:": tuple = ('token_type', 'x1_a37coors_nm', 'x1_a37coors_nm_rel', 'chain_idx_seq', 'incident_bond_type_counts', 'atom37_element_charge_embedding')"},{name:"decoder_feats_seq",val:": tuple = ('ca_coors_nm', 'z_latent_seq', 'token_type', 'cond_residue_type')"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.n_residue_types",description:"<strong>n_residue_types</strong> (<code>int</code>, defaults to <code>147</code>) &#x2014; Residue vocabulary size.",name:"n_residue_types"},{anchor:"diffusers.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.allowed_residue_types",description:`<strong>allowed_residue_types</strong> (<code>list[list[bool]]</code>) &#x2014; <code>(num_token_types, n_residue_types)</code> table of the residue classes
each token type may decode to.`,name:"allowed_residue_types"},{anchor:"diffusers.RFD4ProteinaAutoencoder.nlayers",description:"<strong>nlayers</strong> (<code>int</code>, defaults to <code>12</code>) &#x2014; Trunk layers in each of the encoder and decoder.",name:"nlayers"},{anchor:"diffusers.RFD4ProteinaAutoencoder.token_dim",description:"<strong>token_dim</strong> (<code>int</code>, defaults to <code>768</code>) &#x2014; Token representation width.",name:"token_dim"},{anchor:"diffusers.RFD4ProteinaAutoencoder.nheads",description:"<strong>nheads</strong> (<code>int</code>, defaults to <code>12</code>) &#x2014; Attention heads per layer.",name:"nheads"},{anchor:"diffusers.RFD4ProteinaAutoencoder.dim_cond",description:"<strong>dim_cond</strong> (<code>int</code>, defaults to <code>128</code>) &#x2014; Width of the (unused, zero) conditioning vector.",name:"dim_cond"},{anchor:"diffusers.RFD4ProteinaAutoencoder.pair_repr_dim",description:`<strong>pair_repr_dim</strong> (<code>int</code>, defaults to <code>256</code>) &#x2014; Pair width the trunk layers are constructed with. The released
autoencoder uses no pair bias, so this holds no parameters.`,name:"pair_repr_dim"},{anchor:"diffusers.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.encoder_feats_seq,",description:"<strong>encoder_feats_seq,</strong> decoder_feats_seq (<code>list[str]</code>) &#x2014; Features projected into the encoder and decoder inputs.",name:"encoder_feats_seq,"},{anchor:"diffusers.RFD4ProteinaAutoencoder.atom37_mask",description:"<strong>atom37_mask</strong> (<code>list[list[bool]]</code>) &#x2014; Valid atom37 slots for each residue type, shaped <code>(n_residue_types, 37)</code>.",name:"atom37_mask"}]});var s=e(h,6),P=t(s);o(P,{name:"encode",anchor:"diffusers.RFD4ProteinaAutoencoder.encode",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L583",parameters:[{name:"coords_nm",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:"generator",val:": typing.Union[torch.Generator, list[torch.Generator], NoneType] = None"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaAutoencoder.encode.coords_nm",description:"<strong>coords_nm</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens, 37, 3)</code> atom37 coordinates in nanometers.",name:"coords_nm"},{anchor:"diffusers.RFD4ProteinaAutoencoder.encode.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.RFD4ProteinaAutoencoder.encode.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.RFD4ProteinaAutoencoder.encode.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.RFD4ProteinaAutoencoder.encode.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.`,name:"conditioning"},{anchor:"diffusers.RFD4ProteinaAutoencoder.encode.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) &#x2014; One generator per batch row
for independent stochastic latent samples. Without one, sampling draws from the global stream.`,name:"generator"},{anchor:"diffusers.RFD4ProteinaAutoencoder.encode.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Return a typed output, or a tuple of its fields.",name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Latent, mean and log-scale tensors shaped <code>(batch, tokens, latent_dim)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>RFD4ProteinaEncoderOutput</code> or <code>tuple</code></p>
`}),n(2),r(s);var c=e(s,2),x=t(c);o(x,{name:"decode",anchor:"diffusers.RFD4ProteinaAutoencoder.decode",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L624",parameters:[{name:"z_latent",val:": Tensor"},{name:"ca_coors_nm",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:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaAutoencoder.decode.z_latent",description:"<strong>z_latent</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens, latent_dim)</code> per-token local latents.",name:"z_latent"},{anchor:"diffusers.RFD4ProteinaAutoencoder.decode.ca_coors_nm",description:"<strong>ca_coors_nm</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens, 3)</code> backbone CA positions in nanometers.",name:"ca_coors_nm"},{anchor:"diffusers.RFD4ProteinaAutoencoder.decode.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.RFD4ProteinaAutoencoder.decode.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.RFD4ProteinaAutoencoder.decode.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.RFD4ProteinaAutoencoder.decode.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. The sequence condition is read from here.`,name:"conditioning"},{anchor:"diffusers.RFD4ProteinaAutoencoder.decode.return_dict",description:"<strong>return_dict</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Return a typed output, or a tuple of its fields.",name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Coordinates <code>(batch, tokens, 37, 3)</code> in nanometers, residue types
<code>(batch, tokens)</code>, emission mask <code>(batch, tokens)</code> and atom mask <code>(batch, tokens, 37)</code>. Non-emitted atom
coordinates are zero.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>RFD4ProteinaDecoderOutput</code> or <code>tuple</code></p>
`}),n(2),r(c);var g=e(c,2),A=t(g);o(A,{name:"forward",anchor:"diffusers.RFD4ProteinaAutoencoder.forward",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L666",parameters:[{name:"z_latent",val:": Tensor"},{name:"ca_coors_nm",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:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.RFD4ProteinaAutoencoder.forward.z_latent",description:"<strong>z_latent</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens, latent_dim)</code> per-token local latents.",name:"z_latent"},{anchor:"diffusers.RFD4ProteinaAutoencoder.forward.ca_coors_nm",description:"<strong>ca_coors_nm</strong> (<code>torch.Tensor</code>) &#x2014; <code>(batch, tokens, 3)</code> backbone CA positions in nanometers.",name:"ca_coors_nm"},{anchor:"diffusers.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.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.RFD4ProteinaAutoencoder.forward.conditioning",description:"<strong>conditioning</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014; The remaining topology and conditioning tensors.",name:"conditioning"},{anchor:"diffusers.RFD4ProteinaAutoencoder.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 its fields.",name:"return_dict"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Decoded coordinates, residue types and atom/emit masks.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>RFD4ProteinaDecoderOutput</code> or <code>tuple</code></p>
`}),n(2),r(g),r(d);var k=e(d,2);a(k,{title:"RFD4ProteinaEncoderOutput",local:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput",headingTag:"h2"});var i=e(k,2),w=t(i);o(w,{name:"class diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput",anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L469",parameters:[{name:"latent",val:": Tensor"},{name:"mean",val:": typing.Optional[torch.Tensor] = None"},{name:"log_scale",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput.latent",description:"<strong>latent</strong> (<code>torch.Tensor</code>) &#x2014; Sample <code>mean + noise * exp(log_scale)</code>, zero outside emitted latent tokens.",name:"latent"},{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput.mean",description:"<strong>mean</strong> (<code>torch.Tensor</code>) &#x2014; Gaussian mean, zero outside emitted latent tokens.",name:"mean"},{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaEncoderOutput.log_scale",description:"<strong>log_scale</strong> (<code>torch.Tensor</code>) &#x2014; Log standard deviation, zero outside emitted latent tokens.",name:"log_scale"}]}),n(2),r(i);var y=e(i,2);a(y,{title:"RFD4ProteinaDecoderOutput",local:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput",headingTag:"h2"});var p=e(y,2),O=t(p);o(O,{name:"class diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput",anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput",source:"https://github.com/huggingface/diffusers/blob/vr_15148/src/diffusers/models/autoencoders/autoencoder_rfd4_proteina.py#L484",parameters:[{name:"coordinates",val:": Tensor"},{name:"residue_type",val:": typing.Optional[torch.Tensor] = None"},{name:"emit_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"atom_mask",val:": typing.Optional[torch.Tensor] = None"}],parametersDescription:[{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput.coordinates",description:"<strong>coordinates</strong> (<code>torch.Tensor</code>) &#x2014; Coordinates <code>(batch, tokens, 37, 3)</code> in nanometers; non-emitted atoms are zero.",name:"coordinates"},{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput.residue_type",description:"<strong>residue_type</strong> (<code>torch.Tensor</code>) &#x2014; Residue vocabulary indices shaped <code>(batch, tokens)</code>.",name:"residue_type"},{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput.emit_mask",description:"<strong>emit_mask</strong> (<code>torch.Tensor</code>) &#x2014; Boolean emitted-token mask shaped <code>(batch, tokens)</code>.",name:"emit_mask"},{anchor:"diffusers.models.autoencoders.autoencoder_rfd4_proteina.RFD4ProteinaDecoderOutput.atom_mask",description:"<strong>atom_mask</strong> (<code>torch.Tensor</code>) &#x2014; Boolean valid-atom mask shaped <code>(batch, tokens, 37)</code>.",name:"atom_mask"}]}),n(2),r(p);var N=e(p,2);q(N,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/models/rfd4_proteina_autoencoder.md"}),n(2),D(F,u),U()}export{Q as component};

Xet Storage Details

Size:
19.2 kB
·
Xet hash:
71cc17be59bc80877505861bc34285749aa07031a2da5a9bc615a6980248e24c

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