Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] new card limit in optimizer.find_optimal_retention #600

Closed
aleksejrs opened this issue Jan 28, 2024 · 10 comments · Fixed by open-spaced-repetition/fsrs-optimizer#79
Labels
enhancement New feature or request

Comments

@aleksejrs
Copy link

Which module is related to your feature request?
Optimizer

Is your feature request related to a problem? Please describe.

  • Optimizer (creates a workload graph) limits overall repetitions. It introduces as many new cards as it can fit in max_cost_perday. It doesn't support new_cards_limits, but it can't review overtime.
  • Simulator (shows how many cards you can learn) limits overall repetitions + obeys new_cards_limits. It can't review overtime.
  • Anki can limit overall repetitions and obey new_cards_limits. You can review overtime. But the only built-in way to get a dynamic new card limit like with Optimizer or Cardistry is to limit reviews and review overtime by choice.

That makes it difficult to compare the output.

Describe the solution you'd like
Optimizer should obey a new card limit like Simulator.

Describe alternatives you've considered

  • Merge Optimizer's and Simulator's simulations in some way.
  • Add to Anki a limit that limits new cards based on todays reviews or future due or burden, but does not limit reviews.
@aleksejrs aleksejrs added the enhancement New feature or request label Jan 28, 2024
@L-M-Sherlock
Copy link
Member

It introduces as many new cards as it can fit in max_cost_perday.

Because we should compare the final amount of memorization in the same total cost.

@aleksejrs
Copy link
Author

aleksejrs commented Jan 28, 2024

The workload graph is based on "minutes of study per day", so it fails to achieve a certain goal if you spend less time per day, but more time per card and learn much less.
I guess you could compare it in Simulator if you make new_cards_limits high enough to be limited by review limits, but then it is comparable to Anki only if you use a review+new limit in Anki, which is a small hindrance when you have more due cards sometimes. I am talking about a subdeck, so choosing a limit is complicated.

@L-M-Sherlock
Copy link
Member

L-M-Sherlock commented Jan 28, 2024

If we support new card limit and review card limit separately, the desired retention will be broken.

image

Above pseudo-code is from my paper. The simulator always introduce new cards after the reviews are done, which ensure the desired retention to be achieved.

@aleksejrs
Copy link
Author

aleksejrs commented Jan 28, 2024

Is the above about Optimizer and too different from Simulator? This comment below is about Simulator.

Do you mean Simulator always introduces that 1 card in my deck even if the daily limits have been reached?

But there are both repetitions and time limits:

new_cards_limits = 20
review_limits = 400
max_time_limts = 10000
        for idx in need_learn.index:
            if (
                learned >= new_cards_limits
                or review_time_today + learn_time_today >= max_time_limts
            ):
                break

I incorrectly assumed that they applied to the same thing, but apparently new cards are limited only by the day's time, not reps.

@L-M-Sherlock
Copy link
Member

L-M-Sherlock commented Jan 28, 2024

I guess we are talking two different problems. My focus is the new card limit will mess up the function of finding the optimal retention. If we set new card limit, the real time cost per day will be inconsistent.

Your focus is Anki and the simulator has new card limit, so the optimizer should also have new card limit. But I don't want to introduce the new card limit for the above reason.

@aleksejrs
Copy link
Author

aleksejrs commented Jan 28, 2024

My focus is Anki, because that's where I can use the optimal retention I am trying to find.
But I currently cannot tell Anki to stop showing me new cards on the same conditions as when Optimizer or Simulator does it, and even they use different conditions.

Apparently the function Optimizer uses is simulate() in fsrs-optimizer/src/fsrs_optimizer/fsrs_simulator.py

@L-M-Sherlock
Copy link
Member

My focus is Anki, because that's where I can use the optimal retention I am trying to find.
But I currently cannot tell Anki to stop showing me new cards on the same conditions as when Optimizer or Simulator does it, and even they use different conditions.

But I think it doesn't matter because the key of finding optimal retention is to maximize the memorization with fixed time cost. New card limit will break the time cost consistency.

@aleksejrs
Copy link
Author

aleksejrs commented Jan 28, 2024

Okay, I want to memorize everything by studying 1 minute a day for a week. Not because I don't have the necessary 2 minutes a day, but because I want to save time.

Optimizer determines that it won't work, and shows that on the Cumulative Learn Count graph, which does not say the exact number.

To find out what will work, I guess I should use the separate Simulator, and try different parameters to determine both the time cost and the number of study days. I will waste a lot of time generating the table manually (maybe with a couple regexp to reformat the output into a table), so maybe I should edit the simulator to generate it automatically if I can. Because I won't just guess the exact optimal retention by trying to save time and learn more… And then Optimizer's output will still depend on the input.
By the way, it seems that the optimal retention with my existing time costs is about 82-86%, but maybe that's because it was the retention I targeted when those time costs were measured.

Maybe it's the separate Simulator that should be improved and possibly generate another graph.

What it currently shows:

scheduler: fsrs
learned cards: 831
time in minutes: 667.0
remembered cards: 763
time per remembered card: 0.87
leeches: 3

A graph shows "time in minutes per day (14 days average)". It is hard to determine the number of seconds to specify in Optimizer from the graph. Give it too much, and it will use more time where it could use less at little cost. Simulator allows for spikes thanks to the limit, but Optimizer would use their cost for all days?
Untitled2

Or does Simulator allow for spikes over the limit?

requestRetention = 0.77
# common parameters
maximumInterval = 36500
new_cards_limits = 10
review_limits = 23
max_time_limts = 60
learn_days = 730
deck_size = 831
filename = "___nonimp-post__generalpreset.apkg"
filter_out_suspended_cards = True

Untitled_spike

And after all, I will need to know how many new cards to introduce every day, because I am not going to look at whether I spent the target time cost for each deck that day (I guess the latter would require some really strict time management). So to take advantage of those programs that have time cost as input, Anki also needs to be improved by adding features that had been done in add-ons before.

@L-M-Sherlock
Copy link
Member

But the find_optimal_retention is automatic. It's designed to avoid manual involvement. Comparing the results of optimizer and simulator is unintended.

Simulator allows for spikes thanks to the limit, but Optimizer would use their cost for all days?

They both are now allow to exceed the limit. And they don't run out of cost when all news cards have been learned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants