pub struct DiffusionModule { /* private fields */ }Expand description
AF3-style EDM diffusion module.
Denoises atom coordinates conditioned on single and pair representations produced by the folding trunk. Uses 12 token-level transformer blocks with pair bias conditioning, followed by coordinate output projection.
Implementations§
Source§impl DiffusionModule
impl DiffusionModule
Sourcepub fn load(
vb: VarBuilder<'_>,
c_token: usize,
c_atom: usize,
d_single: usize,
d_pair: usize,
n_token_blocks: usize,
n_token_heads: usize,
fourier_dim: usize,
) -> Result<Self>
pub fn load( vb: VarBuilder<'_>, c_token: usize, c_atom: usize, d_single: usize, d_pair: usize, n_token_blocks: usize, n_token_heads: usize, fourier_dim: usize, ) -> Result<Self>
Load the diffusion module from a VarBuilder rooted at structure_head.*.
§Arguments
vb— builder rooted atstructure_headc_token— token channel dimension (768)c_atom— atom channel dimension (128, reserved for atom transformer TODO)d_single— single repr dimension from folding trunk (384)d_pair— pair repr dimension from folding trunk (256)n_token_blocks— number of token transformer blocks (12)n_token_heads— number of heads per token block (16)fourier_dim— Fourier noise embedding dimension (256)
Sourcepub fn forward(
&self,
single: &Tensor,
pair: &Tensor,
n_atoms: usize,
num_steps: usize,
) -> Result<Tensor>
pub fn forward( &self, single: &Tensor, pair: &Tensor, n_atoms: usize, num_steps: usize, ) -> Result<Tensor>
Run the AF3-style EDM denoising loop.
§Arguments
single— single representation[B, N_tok, d_single]pair— pair representation[B, N_tok, N_tok, d_pair]n_atoms— number of atoms (= N_tok for Cα-only, otherwise N_tok * atoms_per_tok)num_steps— number of denoising steps (14 fast / 50 quality)
§Returns
Token-level coordinates [B, N_tok, 3] in Ångströms (Cα output).
Auto Trait Implementations§
impl Freeze for DiffusionModule
impl !RefUnwindSafe for DiffusionModule
impl Send for DiffusionModule
impl Sync for DiffusionModule
impl Unpin for DiffusionModule
impl UnsafeUnpin for DiffusionModule
impl !UnwindSafe for DiffusionModule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more