pub struct EwcPlusPlusBackend {
pub lambda: f32,
pub phi_scale: f32,
/* private fields */
}Expand description
EWC++ implementation — the canonical production backend. Bidirectional plasticity: strengthens important weights, prunes irrelevant ones.
Fields§
§lambda: f32EWC regularization strength λ
phi_scale: f32Φ-weighting scale (0.0 = ignore Φ, 1.0 = full Φ-weighting)
Implementations§
Source§impl EwcPlusPlusBackend
impl EwcPlusPlusBackend
pub fn new(lambda: f32) -> Self
Sourcepub fn consolidate(
&mut self,
weight_id: WeightId,
weights: Vec<f32>,
phi: Option<f32>,
)
pub fn consolidate( &mut self, weight_id: WeightId, weights: Vec<f32>, phi: Option<f32>, )
Consolidate current weights as the new optimal point. Called after learning a task to protect it from future forgetting.
Sourcepub fn update_fisher(&mut self, weight_id: WeightId, gradient: &[f32])
pub fn update_fisher(&mut self, weight_id: WeightId, gradient: &[f32])
Update Fisher diagonal from gradient samples (online estimation).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EwcPlusPlusBackend
impl RefUnwindSafe for EwcPlusPlusBackend
impl Send for EwcPlusPlusBackend
impl Sync for EwcPlusPlusBackend
impl Unpin for EwcPlusPlusBackend
impl UnsafeUnpin for EwcPlusPlusBackend
impl UnwindSafe for EwcPlusPlusBackend
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