open-spaced-repetition / fsrs4anki

A modern Anki custom scheduling based on Free Spaced Repetition Scheduler algorithm
https://github.com/open-spaced-repetition/fsrs4anki/wiki
MIT License
2.77k stars 137 forks source link

[Question] Do the stability and difficulty not change when the card is in `Learning` state? #663

Closed milmillin closed 4 months ago

milmillin commented 4 months ago

Do you have a doubt about using FSRS in Anki? If so, please post on https://forums.ankiweb.net/ instead.

This issue tracker is primarily intended for questions and suggestions about the algorithm itself, rather than its usage in Anki. In addition, a larger community can provide support on the Anki Forums.

Before posting, please read the following:

Research

Enter an [x] character to confirm the points below:

Question

Upon inspection of the algorithm implemented in ts-fsrs and py-fsrs (which are the exact transliteration of each other), I noticed that when the card is in the Learning state, we don't update the difficulty nor the stability of the card. However, when you calculate the interval, it seems that not updating difficulty and stability is not the intended behavior.

You can demonstrate it quickly in the web demo by first selecting Good then repeatedly selecting Again or Hard. You will see that the stability and difficulty do not change. Is this intended?

I have made a detailed description of the FSRS 4.5 algorithm (from reading the implementation) here. Or has there already been a detailed description other than this wiki page? Did I misunderstand something?

Specifically, in Python, calling s = SchedulingCards(card) copies card to s.again, s.hard, etc. https://github.com/open-spaced-repetition/py-fsrs/blob/f443b6ebddd11f45124bb2a3569d25ed3e64c977/src/fsrs/fsrs.py#L43-L48 If the card state is Learning, there is no call to update stability and difficulty; but you seem to refer to s.good.stability and s.easy.stability to calculate the interval.

The current implementation would be equivalent to

# good_interval = self.next_interval(s.good.stability)
# easy_interval = max(self.next_interval(s.easy.stability), good_interval + 1)
good_interval = self.next_interval(card.stability)
easy_interval = good_interval + 1

I skimmed the implementation in this repo, but it is not clear to me if this is the same behavior (I don't understand the Anki language enough).

Edit: There seem to be the exact same issue here: https://github.com/open-spaced-repetition/py-fsrs/issues/6 However, the fix still doesn't seem right.

P.S. Feel free to share my notes on your website if you find it useful.

L-M-Sherlock commented 4 months ago

It's intended in FSRS-4.5. FSRS-4.5 doesn't consider the short-term reviews, so the memory state won't be updated during Learning stage.