pub struct AttentionState {
pub learned_weights: [f32; 7],
pub history: Vec<AttentionOutcome>,
pub last_recall_ms: u64,
pub total_recalls: u32,
}Fields§
§learned_weights: [f32; 7]Learned optimal weights (running average from good outcomes).
history: Vec<AttentionOutcome>Recent outcome history.
last_recall_ms: u64Last recall timestamp for quality inference.
total_recalls: u32Total recalls tracked.
Implementations§
Source§impl AttentionState
impl AttentionState
pub fn load_or_init(output_dir: &Path) -> Self
Sourcepub fn compute_attention(&self, signals: &AttentionSignals) -> AttentionVector
pub fn compute_attention(&self, signals: &AttentionSignals) -> AttentionVector
Compute attention vector from context signals.
Sourcepub fn infer_quality(&self) -> f32
pub fn infer_quality(&self) -> f32
Infer quality of last recall from time gap. Returns quality score (0.0 = bad, 1.0 = good).
Sourcepub fn record_outcome(&mut self, quality: f32, weights: &[f32; 7])
pub fn record_outcome(&mut self, quality: f32, weights: &[f32; 7])
Record the outcome of a recall (the quality applies to the PREVIOUS recall).
Sourcepub fn mark_recall(&mut self)
pub fn mark_recall(&mut self)
Mark that a recall just happened (for next quality inference).
Auto Trait Implementations§
impl Freeze for AttentionState
impl RefUnwindSafe for AttentionState
impl Send for AttentionState
impl Sync for AttentionState
impl Unpin for AttentionState
impl UnsafeUnpin for AttentionState
impl UnwindSafe for AttentionState
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> 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