pub struct StructureTokenEncoder { /* private fields */ }Expand description
Encodes backbone coordinates into discrete structure tokens via a 2-layer geometric mini-transformer followed by nearest-neighbour VQ codebook lookup.
Weight layout (in encoder checkpoint):
encoder.blocks.*— transformerpre_vq_proj.weight—(d_codebook, enc_d_model)codebook.embeddings—(n_codes, d_codebook)
Implementations§
Source§impl StructureTokenEncoder
impl StructureTokenEncoder
pub fn load(vb: VarBuilder<'_>, config: VqVaeConfig) -> Result<Self>
Sourcepub fn encode(
&self,
coords: &Tensor,
sequence_id: Option<&Tensor>,
chain_id: Option<&Tensor>,
) -> Result<Tensor>
pub fn encode( &self, coords: &Tensor, sequence_id: Option<&Tensor>, chain_id: Option<&Tensor>, ) -> Result<Tensor>
Encode backbone coordinates into structure tokens.
coords:(B, L, 3, 3)backbone(N, CA, C)positions.sequence_id: optional(B, L)bin-packing IDs.chain_id: optional(B, L)chain IDs.
Returns (B, L) u32 structure token indices.
Auto Trait Implementations§
impl Freeze for StructureTokenEncoder
impl !RefUnwindSafe for StructureTokenEncoder
impl !Send for StructureTokenEncoder
impl !Sync for StructureTokenEncoder
impl Unpin for StructureTokenEncoder
impl UnsafeUnpin for StructureTokenEncoder
impl !UnwindSafe for StructureTokenEncoder
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