Skip to content

Commit

Permalink
Clip post lapse stability (#72)
Browse files Browse the repository at this point in the history
* clip post lapse stability

* bump patch number
  • Loading branch information
joshdavham authored Dec 19, 2024
1 parent beb17cb commit f18100d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fsrs"
version = "4.1.0"
version = "4.1.1"
description = "Free Spaced Repetition Scheduler"
readme = "README.md"
authors = [{ name = "Jarrett Ye", email = "[email protected]" }]
Expand Down
11 changes: 10 additions & 1 deletion src/fsrs/fsrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,13 +731,22 @@ def _next_stability(
def _next_forget_stability(
self, difficulty: float, stability: float, retrievability: float
) -> float:
return (
next_forget_stability_long_term_params = (
self.parameters[11]
* math.pow(difficulty, -self.parameters[12])
* (math.pow(stability + 1, self.parameters[13]) - 1)
* math.exp((1 - retrievability) * self.parameters[14])
)

next_forget_stability_short_term_params = stability / math.exp(
self.parameters[17] * self.parameters[18]
)

return min(
next_forget_stability_long_term_params,
next_forget_stability_short_term_params,
)

def _next_recall_stability(
self, difficulty: float, stability: float, retrievability: float, rating: Rating
) -> float:
Expand Down

0 comments on commit f18100d

Please sign in to comment.