pub struct EwcPlusPlus { /* private fields */ }Implementations§
Source§impl EwcPlusPlus
impl EwcPlusPlus
pub fn new(config: EwcConfig) -> Self
Sourcepub fn consolidate(&mut self, params: &Array1<f32>, fisher: &Array1<f32>)
pub fn consolidate(&mut self, params: &Array1<f32>, fisher: &Array1<f32>)
Consolidate current parameters after training
Sourcepub fn penalty_gradient(&self, params: &Array1<f32>) -> Option<Array1<f32>>
pub fn penalty_gradient(&self, params: &Array1<f32>) -> Option<Array1<f32>>
Compute gradient of EWC penalty
Sourcepub fn compute_fisher(gradients: &[Array1<f32>]) -> Array1<f32>
pub fn compute_fisher(gradients: &[Array1<f32>]) -> Array1<f32>
Compute Fisher information from gradients
pub fn has_prior(&self) -> bool
pub fn task_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for EwcPlusPlus
impl RefUnwindSafe for EwcPlusPlus
impl Send for EwcPlusPlus
impl Sync for EwcPlusPlus
impl Unpin for EwcPlusPlus
impl UnsafeUnpin for EwcPlusPlus
impl UnwindSafe for EwcPlusPlus
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