WeightUpdate

Trait WeightUpdate 

Source
pub trait WeightUpdate: Send + Sync {
    // Required methods
    fn apply(
        &self,
        target: &mut [f32],
        source: &[f32],
        lr: f32,
    ) -> Result<(), RloxError>;
    fn name(&self) -> &str;
}
Expand description

Trait for weight vector update strategies.

All operations are in-place on flat f32 weight vectors. This enables adding new meta-learning update rules (MAML outer step, Lookahead, exponential moving average variants) without modifying existing code.

Required Methods§

Source

fn apply( &self, target: &mut [f32], source: &[f32], lr: f32, ) -> Result<(), RloxError>

Apply the update rule in-place.

target is modified. source is read-only. lr controls step size.

§Errors

Returns ShapeMismatch if target.len() != source.len().

Source

fn name(&self) -> &str

Human-readable name.

Implementors§