pub struct SwiGLU { /* private fields */ }Implementations§
Source§impl SwiGLU
impl SwiGLU
Sourcepub fn load(vb: VarBuilder<'_>, config: &ESM3Config) -> Result<Self>
pub fn load(vb: VarBuilder<'_>, config: &ESM3Config) -> Result<Self>
Load the FFN, taking the bias terms from the checkpoint rather than assuming they are absent (ferritin-100.27).
The two checkpoints that share this block disagree, and hardcoding either answer is silently wrong for the other:
| checkpoint | ffn.1.bias / ffn.3.bias |
|---|---|
esm3_sm_open_v1.pth (the sequence model) | absent |
esm3_structure_encoder_v0.pth (the VQ-VAE encoder) | present |
This used to be linear_no_bias unconditionally, which is correct for
the sequence model and drops two real tensors per block for the
structure encoder. Nothing caught it: the loader only ever asked for the
weights, so “every tensor resolves” stayed true while the biases sat
unread in the file. The cost was ~4% drift in the encoder’s latent —
invisible to any self-consistency check, but enough to move 11 of 93
residues onto a different codebook entry.
Probed rather than made a config flag because the checkpoint is the
authority here, and the same probing idiom already resolves ESM-C’s
wrapper prefix in loader::optional_prefix.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SwiGLU
impl !UnwindSafe for SwiGLU
impl Freeze for SwiGLU
impl Send for SwiGLU
impl Sync for SwiGLU
impl Unpin for SwiGLU
impl UnsafeUnpin for SwiGLU
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
§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> ⓘ
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> ⓘ
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> ⓘ
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