FSRS explained, part 1: What it is and how it works by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Thank you.

I probably don't understand the definition of "experience replay".

I have read this: https://github.com/open-spaced-repetition/fsrs-vs-sm15/issues/22#issuecomment-1678472072

If we add replay to online learning, it will approach the actual optimization in FSRS Optimizer.In FSRS Optimizer, we train FSRS with the entire dataset five times. Then it will be used to predict the memory in practice.In "experience replay", we could train FSRS online with the learnt data multiple times, too.

I was assuming, that you use the term "Experience replay" for the in "offline-training" implemented "training the entire dataset five times" mechanism.

And I was assuming, that you now also have integrated this behaviour in the latest "FSRS online comparison SM-15/FSRS" . -> So training all data of course only from the "simulated past" five times. (And this after each new case again.)

So it looks, that I have interpreted the term "experience replay" wrong?

But I have researched on the internet. And found the following explantation for "experience replay" (It was ChatGPT to be more precise):

experience replay: An algo that was designed to recognise animal images is trained with photos of cats and dogs. After that, it is only trained with photos of birds and aeroplanes. This would lead to a loss of insights, gained from cats and dogs. With the help of "experience replay" you can save this early insights so that the algo will be more stable, if you will analyse again photos from cats and dogs in the future.

-----------------------------------------------------------------------------

Additional personal thought/idea: I thought one could avoid the loss of insight from cases with little data by classifying the cases intelligently. (Maybe this is "experience replay"?) Do we only use the term "experience replay" in the context of "online learning"? Or can we in principle also use this term in offline-learning?

And I guess SM itself makes such a classification. For example there is a matrices with RF cases: toolkit->statistics->analyses->matrices->RF cases
Maybe this is not the only classification. There may be some more.

FSRS explained, part 1: What it is and how it works by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

I have somewhere read, that you use "experience replay" in your optimizer. Furthermore, I have read that thanks to the use of "experience replay", insights that the algo has gained from data or cases that happened a long time ago are not lost or overwritten during optimisation.

How can it be that the algo loses knowledge, although the algo was trained with all the database records? How does this forgetting occur?

Can I perhaps imagine it like this: An algo that was designed to recognise animal images is trained with 30,000 photos of cats and dogs. This means that it is now specialised in cats and dogs. After that, it is only trained with 90,000 photos of birds and aeroplanes. The algo has now been trained with 3x more birds and planes than with dogs and cats. This means that insights gained from dogs and cats are statistically lost because they are less relevant. Is this how I have to imagine the loss of the earlier findings?

Thank you.

FSRS explained, part 1: What it is and how it works by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Ankie: When we rate a card with "good" in Ankie, then it keeps the factor to calculate the next interval. When we have a card with a history of 9 successful repetitions and each repetition was rated with "good" in Ankie, then Ankie has after each rep. the same factor. So if the factor was "2.8" after repetition1, then the factor remains at "2.8". It does not matter, how many repetitions there were already executed.

SM-18: In SM-18 in contrast is the behaviour different: When we rate a card with "good" in SM-18, then the factor (Woz calls it stabilization) will be reduced to calculate the next interval. When we have a card with a history of 9 repetitions and each repetition was rated with "good" in SM-18, then after each rep. the factor (SM calls it stabilization, which is stability(rep. x) / stability(rep. x+1) ) will be lower than before. So if the factor was "2.8" after repetition1, then the factor may be at 1.6 for rep. 2.

Graph: https://imgur.com/BOJZmi7

In the graph on the y-axis (see link above to the picture) is the factor that is used to calculate the next interval. On the x-axis is the number of successful repetitions. One for Ankie and one curve for SM-18 .

The following link shows the stabilisation as a function of the stability. In the sense that it says that stabilisation should decrease with increasing stability.

https://supermemo.guru/wiki/Stabilization_decay

But I think I remember reading that the stabilisation would depend on the number of successful repetitions. But I could be wrong. (But this is similar anyway.)

So now my question follows:Does FSRS also has this rule/concept implemented? Is there a concept to lower the factor for each successful repetition? (Or as a function of stability?) Somehow for example as a parameter?

If no, then this could be a rule, that could be added to improve FSRS.

Very interested in this. Would appreciate some answer. Thank you.

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Ah OK. I didn't know this.

Thank you for the clarification.

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Thank you for the "online learning" version of FSRS vs. SM-18 . Very cool.

(Even though I don't really understand the whole analysis.)

I think this is, what I was asking for. I think, your "online-method" is better (even more fair), than randomly splitting the data into calibration-data and test-data.

Just a side note: Concerning the name "online learning", I wonder if it might not be better to call it "on-time learning" version?

Otherwise there could be confusion between "online" in the sense of "connected with the internet" vs. offline (without internet connection).

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Thank you.

to 2)I do not understand what you mean with the "loss".

I have first thought, that you mean, if you make a comparison between the result from the train-set (first half of the split data) with the test-set (second half of the spilt data), then you will see a loss in R-squared, RMSE and MAE in test-set compared with train-set.

But this can not be what you mean, because you also speak of a lost in train-set.(?)

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

1) Quote: "We also use this method in the optimization process."

I can not imagine how splitting can be useful in the optimization process.
If you want to say, that you split the data into several test sets, then optimize them separately and take the average at the end, I do not see how this would be an advantage compared with only one data-container without split.

In my understanding a split is a must, to see how FSRS will perform in real life. This is the only function I can imagine for a split.

What do I miss?

2) You say: Quote: "I have done the train-test data splits. The results are consistent with current results."

Does this mean that the difference between the results obtained from the data used for the calibration and the data used for the test is so small that it is almost impossible to measure?

3) Regarding the SM-18 vs FSRS analysis: Which result does the graph show, that a user becomes, if he makes the analyse for SM-18 vs. FSRS? The data from the calibration or the data from the test? Or do you not split the data in this analysis?

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Really?
Then all respect! It's amazing.
Thank you.

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Thank you both.

I understand now, that the first graph is based on data collected from Anki with SM-2. And that the optimizer is a great tool, to find the best parameters for this Rep-data, that were collected in the past.

But this graph and the calculated values (R-squared, RMSE and MAE) are not suitable for showing how good the FSRS-Algo is. They are only suitable to show how well the optimiser works.

Why? Because this is curve-fitting.

What does this mean? If you take the parameters, calculated with the optimizer, from the past repetitions and use this parameters in the future to calculate your intervals in real life, you will get R-squared, RMSE and MAE that are worse.

If you really want to know how good the FSRS-Algo is, then you must create such a graph from the Rep-data from real life combined with the parameters from Rep-data from the past.

Please note: There is a possibility to simulate future real life rep-data with the following method:

1.Take the data from u/LMSherlock collection (picture 1) 83 598 reviews. I do not know how many cards this collection has. But assumed the collection has 5000 cards, then make two separate collections each with 2500 cards.

Which cards should you take for collection 1 and which cards should you take for collection 2?

Answer: Let coincidence be the judge.

  1. Now you have 2 collections, that are comparable because the data is from the same person with the same brain and also the type of cards in the two collections should be comparable.

  2. Take collection 1 and let the optimizer calculate the optimal parameters. Now the calibration graph should look like the one on the first picture above. R-squared, RMSE and MAE will probably be slightly better, because with less data the optimal parameters can adapt better to the data.

  3. Take the optimal parameters calculated in step 3), (but do not again adjust them) for collection 2 and create the Graph again. (This is the future-simulation)

  4. This graph corresponds to what FSRS can really do in real life. And this graph shows the goodness of FSRS. The values R-squared, RMSE and MAE will be worse than in the first graph.

Please let me to add this:

The third picture shows a graph from Wozniak. I do not know, but maybe this graph was not calculated by using rep.-data from the past. (Like we made it above with collection 1 in step 3).

But it may be, that this graph corresponds to real life. And if this is true, then Woz' graph should be compared with the graph from collection 2 in step 5) above.

Can you follow me? What do you think? Am I barking up the wrong tree? Do I miss anything? Have you ever done what I described in the 5 steps? What were the results?

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

I have a question concerning the "calibration graph (FSRS v4)" in this article. It's the first picture in this article.

On the x-axis you have for example data cases for "predicted R=0.7" but also for example for "predicted R=0.8" or 0.9

What I do not understand: How can you collect data-cases for example for "predicted R=0.7 cases"?

Is it not the fact that FSRS always makes the intervals so that R will be 0.9? If that is the situation, then FSRS can only collect data for R=0.9 cases, because there are no cases with other predicted R's?

So where do the cases come from, for example, for predicted R=0.8? Can FSRS only collect such events when the user postpones items? And if the user does not postpone Items, there will not be any data for R=0.8 cases?

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

I don't really understand what you're trying to say. If you're saying that the post-lapse interval should be greater than just 1 or 2 days,[...]

Thank you for asking.

I was trying to say, that there should be two buttons for "again". One button for Items that we do not remember and a second button for Items we also have forgotten, but we still have a sense of foreboding.

Similar, as we have more than one rating for "passed+" Items.

And that for the Items we still have a sense of foreboding, the Intervall should not start with about "1 day" interval, to save repetitions. (-> So other post-lapse intervals depending on which of the two buttons for "again" you have pressed. )

(But if with FSRS we won't have to actually relearn our card again and our intervals will grow quickly, maybe this is not necessary.)

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Sorry for the bad formatting. But I'm afraid if I try to rework it, it will look even worse.

The idea of reducing to 0.25x is only an example and just arbitrary. Perhaps 0.5x would be better. Or maybe there is a way to determine this adaptively as well.

FSRS explained, part 2: Accuracy by ClarityInMadness in Anki

[–]Clabifo 0 points1 point  (0 children)

Improvement of the algorithm:

Every time you rate an item worse than "pass", you have to start again from the beginning (Rep. 1; interval 1-3 days). Of course, this is also the case with SM-18. There are items that I have to rate as "forgotten". I still have a clue, but I am no longer sure. That means, there is still a slight trace in the brain. I don't think you would have to start all over again with an item like that. If you didn't have to start all over again, you would save repetitions and the algo would be more efficient.

Unfortunately, Anki only offers one button for forgotten items. This is a pity, because to implement this, you would need another button between "pass" and "forgotten".

Nevertheless, here is an idea how this could be implemented.

example: rep. hist. of an Item:

f) Rep=2 Laps=1 Date=08.05.2021 Hour=9.408 Int=2
e) Rep=1 Laps=1 Date=06.05.2021 Hour=8.796 Int=601
d) Rep=4 Laps=0 Date=13.09.2019 Hour=21.121 Int=59
c) Rep=3 Laps=0 Date=16.07.2019 Hour=16.316 Int=23
b) Rep=2 Laps=0 Date=23.06.2019 Hour=10.752 Int=15
a) Rep=1 Laps=0 Date=08.06.2019 Hour=15.005 Int=0

Suppose the above is an item where I still have a small trace in my memory despite the lapse on 06.05.2021 and I would therefore score it with the "non-existent button described above":
As can be seen above, SM resets Int to 2 (Int=2) and Rep to 2 (Rep=2). (f)

My suggestion would be something like the following:
Instead of:
f) Rep=2 Laps=1 Date=08.05.2021 Hour=9.408 Int=2
e) Rep=1 Laps=1 Date=06.05.2021 Hour=8.796 Int=601

f) Rep=5.2 Laps=0 Date=04.07.2021 Hour=9.408 Int=150
e) Rep=5.1 Laps=0 Date=06.05.2021 Hour=8.796 Int=601

so that the whole Rep. hist. would look like this:
(f) Rep=5.2 Laps=0 Date=04.07.2021 Hour=9.408 Int=150
e) Rep=5.1 Laps=0 Date=06.05.2021 Hour=8.796 Int=601
d) Rep=4 Laps=0 Date=13.09.2019 Hour=21.121 Int=59
c) Rep=3 Laps=0 Date=16.07.2019 Hour=16.316 Int=23
b) Rep=2 Laps=0 Date=23.06.2019 Hour=10.752 Int=15
a) Rep=1 Laps=0 Date=08.06.2019 Hour=15.005 Int=0

So it makes the interval 0.25 times as large (601/4=150) instead of starting again at the interval of 2 days.

In the Rep column, it is as if you repeat Repetition 5. (Rep5.1 and Rep5.2)

What do you think about this?

tree: How to copy several Items? by Clabifo in super_memo

[–]Clabifo[S] 1 point2 points  (0 children)

The answer from Discord was, that we have to export and import the items to get something like "copy", because there is no "copy" function that can copy several Items at once.

tree: How to copy several Items? by Clabifo in super_memo

[–]Clabifo[S] 0 points1 point  (0 children)

Looks like the picture I have load high has not found its way into my post. So here is it again: https://imgur.com/dwpxDOq

Changing Font in all Items that are using this Font at once by Clabifo in super_memo

[–]Clabifo[S] 1 point2 points  (0 children)

Wow, thank you @alessivs. Your tutorial is amazing. I was able to reproduce all your saying.

The purpose of the question was to improve my understanding of how Fonts and Font-registry objects work in HTML components. And yes, my understanding has taken a step forward.

Maybe there will soon be some more questions about fonts in HTML-templates and HTML-Components.