feat: fit Ebbinghaus and exponential forgetting curves to recall@T data#19
Open
Priyanshu-byte-coder wants to merge 1 commit into
Open
Conversation
Adds fit_forgetting_curve() to evaluation/stats.py which accepts a list of (checkpoint, recall) pairs and returns: - exponential model: a, k (decay rate), half-life (ln2/k), R² - Ebbinghaus model: stability S, half-life (numerical), R² The exponential model uses log-linear least squares (no extra dependencies). The Ebbinghaus model uses a fine grid search over S ∈ [0.01, 20] to avoid introducing a scipy dependency. Exposed via --fit-curves CLI flag: python main.py --fit-curves python main.py --seeds 5 --fit-curves Half-life and stability let researchers compare how quickly each memory backend 'forgets' injected facts as a single interpretable scalar rather than reading recall curves point-by-point. Closes Neal006#6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements forgetting-curve fitting requested in issue #6.
New function:
evaluation/stats.py — fit_forgetting_curve()Accepts
(checkpoints, recalls)and fits two models:Exponential decay
R(t) = a · exp(−k · t)a,k,half_life = ln(2) / k,R²Ebbinghaus forgetting curve
R(t) = exp(−t̂ / (S · √(1 + t̂)))t̂ = t / t_max(normalised)S= stability constant; higher = slower forgettingstability,half_life(numerical),R²CLI flag:
--fit-curvesExample output:
Half-life and stability give researchers a single interpretable scalar per backend rather than requiring point-by-point curve inspection.
Closes #6