pub struct BakedMaskEncoder { /* private fields */ }Expand description
A tiny MLP whose weights are deterministically “baked” from a mask’s 64-float signature_vector.
Architecture: Linear(64→H) → ReLU → Linear(H→64)
Weight derivation (fully deterministic, no training needed):
- Each weight is seeded by BLAKE3 hash of the signature, ensuring structurally unique encoders per mask.
Memory: (64H + H + H64 + 64) * 4 bytes ≈ 66 KB for H=128
Implementations§
Source§impl BakedMaskEncoder
impl BakedMaskEncoder
Sourcepub fn from_signature(signature: &[f32], hidden: usize) -> Self
pub fn from_signature(signature: &[f32], hidden: usize) -> Self
Bake an encoder from a mask’s signature vector.
Sourcepub fn forward(&self, input: &[f32; 64]) -> [f32; 64]
pub fn forward(&self, input: &[f32; 64]) -> [f32; 64]
Forward pass: x → Linear → ReLU → Linear → output
Sourcepub fn reconstruction_error(&self, features: &[f32; 64]) -> f32
pub fn reconstruction_error(&self, features: &[f32; 64]) -> f32
Reconstruction error (MSE) between input features and reconstruction
Sourcepub fn memory_bytes(&self) -> usize
pub fn memory_bytes(&self) -> usize
Memory usage in bytes
Auto Trait Implementations§
impl Freeze for BakedMaskEncoder
impl RefUnwindSafe for BakedMaskEncoder
impl Send for BakedMaskEncoder
impl Sync for BakedMaskEncoder
impl Unpin for BakedMaskEncoder
impl UnsafeUnpin for BakedMaskEncoder
impl UnwindSafe for BakedMaskEncoder
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