pub struct GatingPatternRecorder { /* private fields */ }Expand description
Records SSM gating weights over time and provides cross-correlation analysis.
Implementations§
Source§impl GatingPatternRecorder
impl GatingPatternRecorder
Sourcepub fn new(max_steps: usize) -> Self
pub fn new(max_steps: usize) -> Self
Create a recorder that stores up to max_steps gating vectors.
Sourcepub fn record(&mut self, gate: &Array1<f32>) -> ModelResult<()>
pub fn record(&mut self, gate: &Array1<f32>) -> ModelResult<()>
Record one gating vector. Returns an error if max_steps is already reached.
Sourcepub fn as_matrix(&self) -> ModelResult<Array2<f32>>
pub fn as_matrix(&self) -> ModelResult<Array2<f32>>
Return the recorded patterns as a (T, D) matrix.
Sourcepub fn cross_correlation(&self) -> ModelResult<Array2<f32>>
pub fn cross_correlation(&self) -> ModelResult<Array2<f32>>
Compute the (D, D) Pearson cross-correlation matrix between dimensions.
Diagonal entries are 1.0 (self-correlation). For zero-variance dims, correlation is set to 0.0.
Return (dim_a, dim_b, correlation) pairs where |correlation| >= threshold.
Trait Implementations§
Source§impl Clone for GatingPatternRecorder
impl Clone for GatingPatternRecorder
Source§fn clone(&self) -> GatingPatternRecorder
fn clone(&self) -> GatingPatternRecorder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GatingPatternRecorder
impl RefUnwindSafe for GatingPatternRecorder
impl Send for GatingPatternRecorder
impl Sync for GatingPatternRecorder
impl Unpin for GatingPatternRecorder
impl UnsafeUnpin for GatingPatternRecorder
impl UnwindSafe for GatingPatternRecorder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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