pub struct DecayAwareSalienceObjective {
pub decay_rate: f64,
}Expand description
Scores a NoteCandidate by salience with configurable temporal decay.
The decay formula is determined by the configured DecayModel (injected at
construction time). The default DecayModel::Exponential uses the note’s own
decay_factor: salience * exp(-decay_factor * age_days).
This objective participates in WeightedObjective composition alongside
RrfFusionObjective and TemporalRecencyObjective to form the full recall
scoring pipeline.
Fields§
§decay_rate: f64Exponential decay rate k (>= 0.0). Score = salience * exp(-k * age_days).
Corresponds to the per-note decay_factor parameter stored on memory notes.
Implementations§
Source§impl DecayAwareSalienceObjective
impl DecayAwareSalienceObjective
Sourcepub fn new(decay_rate: f64) -> Self
pub fn new(decay_rate: f64) -> Self
Create a new objective with the given exponential decay rate.
decay_rate = 0.01 gives a ~69-day half-life (default for memory notes).
Sourcepub fn default_memory() -> Self
pub fn default_memory() -> Self
Default memory decay rate: 0.01 (~69-day half-life).
Trait Implementations§
Source§impl Objective<NoteCandidate> for DecayAwareSalienceObjective
impl Objective<NoteCandidate> for DecayAwareSalienceObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs.Source§fn select<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§fn select_top<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Auto Trait Implementations§
impl Freeze for DecayAwareSalienceObjective
impl RefUnwindSafe for DecayAwareSalienceObjective
impl Send for DecayAwareSalienceObjective
impl Sync for DecayAwareSalienceObjective
impl Unpin for DecayAwareSalienceObjective
impl UnsafeUnpin for DecayAwareSalienceObjective
impl UnwindSafe for DecayAwareSalienceObjective
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
Source§impl<O, T> DeterministicObjective<T> for O
impl<O, T> DeterministicObjective<T> for O
Source§fn select_deterministic<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Result<Selection<&'a T>, ObjectiveError>
fn select_deterministic<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Result<Selection<&'a T>, ObjectiveError>
Source§fn select_top_deterministic<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top_deterministic<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
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>
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>
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