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

[Question] Huge Backlog after rescheduling. Why? #382

Closed
3 tasks done
topherbuckley opened this issue Jul 23, 2023 · 22 comments
Closed
3 tasks done

[Question] Huge Backlog after rescheduling. Why? #382

topherbuckley opened this issue Jul 23, 2023 · 22 comments
Labels
question Further information is requested

Comments

@topherbuckley
Copy link

Research

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

  • I have checked the FAQ and could not find an answer to my question
  • I have read the wiki and still felt confused
  • I have searched for similar existing questions here

Question

I'm seeing a HUGE number of cards rescheduled for negative intervals after rescheduling using the FSRS4Anki Helper-->Reschedule all cards. Is this normal? Here is the stats before/after running it (Before on left, after on right)

image

I've been using Anki for over 10 years, so have a fairly large collection, and several decks/subdecks. I ran the command line training on all decks/subdecks individually, and some did not have enough data for pretraining, but those that did, I ran the optimization and used the weights and recommended optimized requestRetention. I added the decks that did not have enough data to the skip_decks array as well.

Here is the configuration in the .js script I used:

const deckParams = [
  {
    // Default parameters of FSRS4Anki for global
    "deckName": "global config for FSRS4Anki",
    "w": [0.84, 0.88, 4.87, 365.0, 5.1414, 1.6136, 0.8024, 0.0, 1.6659, 0.2308, 1.4942, 2.6023, 0.0144, 0.314, 0.969, 0.374, 3.8865],
    "requestRetention": 0.8768412522493536,
    "maximumInterval": 36500,
  },
    {
    // Generated, Optimized anki deck settings
    "deckName": "Japanese",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [0.84, 0.88, 4.87, 365.0, 5.1414, 1.6136, 0.8024, 0.0, 1.6659, 0.2308, 1.4942, 2.6023, 0.0144, 0.314, 0.969, 0.374, 3.8865],
    "requestRetention": 0.8768412522493536,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Japanese:OkiDaiVocab",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [1.23, 1.27, 5.04, 365.0, 4.7158, 1.3936, 0.9831, 0.0008, 1.9713, 0.1, 1.4875, 2.2424, 0.0344, 0.3162, 0.8937, 0.447, 2.6458],
    "requestRetention": 0.9303468748991642,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Japanese::ボーの日本語",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [0.78, 0.85, 3.41, 30.0, 4.9681, 1.1266, 1.0391, 0.019, 1.5867, 0.483, 1.0572, 2.3996, 0.0485, 0.4443, 1.0235, 0.0, 2.3714],
    "requestRetention": 0.8024824942091109,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Kanji",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [1.44, 1.48, 2.92, 30.0, 4.7891, 0.4994, 1.2556, 0.0381, 1.6698, 0.5067, 1.1165, 2.4327, 0.0534, 0.5731, 1.5381, 0.0001, 3.2201],
    "requestRetention": 0.709820087609512,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Kanji::reading",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [1.44, 1.48, 2.92, 30.0, 4.7891, 0.4994, 1.2556, 0.0381, 1.6698, 0.5067, 1.1165, 2.4327, 0.0534, 0.5731, 1.5381, 0.0001, 3.2201],
    "requestRetention": 0.709820087609512,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Kanji::writing",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [1.44, 1.48, 2.92, 30.0, 4.7891, 0.4994, 1.2556, 0.0381, 1.6698, 0.5067, 1.1165, 2.4327, 0.0534, 0.5731, 1.5381, 0.0001, 3.2201],
    "requestRetention": 0.709820087609512,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Japanese::HarryPotter",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [0.79, 0.94, 9.37, 30.0, 5.0192, 1.0327, 1.0795, 0.0864, 1.5419, 0.3137, 1.0006, 2.2963, 0.0494, 0.3881, 0.9472, 0.0222, 2.2969],
    "requestRetention": 0.8714022193399625,
    "maximumInterval": 36500,
},
{
    // Generated, Optimized anki deck settings
    "deckName": "Japanese::JapaneseCore",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [12.58, 13.41, 30.0, 365.0, 4.4911, 1.1503, 0.7932, 0.1496, 1.9332, 0.1, 1.3707, 2.3661, 0.0314, 0.4933, 1.52, 0.2191, 2.9873],
    "requestRetention": 0.9556207584830338,
    "maximumInterval": 36500,
},
];

// To turn off FSRS in specific decks, fill them into the skip_decks list below.
// Please don't remove it even if you don't need it.
const skip_decks = ["Japanese::CodeGeass", "Japanese::JapaneseClimbingTerms", "Japanese::pod101", "Japanese::ProperNames", "Japanese::テルマエ・ロマエ", "Japanese::RegionsAndPrefectures"];

// "Fuzz" is a small random delay applied to new intervals to prevent cards from
// sticking together and always coming up for review on the same day
const enable_fuzz = true;

// FSRS supports displaying memory states of cards.
// Enable it for debugging if you encounter something wrong.
const display_memory_state = true;
@topherbuckley topherbuckley added the question Further information is requested label Jul 23, 2023
@L-M-Sherlock
Copy link
Member

Because FSRS predicts that those cards' retention is lower than your requested retention.

@topherbuckley
Copy link
Author

Thank you for your reply. Can you help me understand where in your equations this negative interval is calculated? I'm curious to know why some are more negative than others, such that I can get a sense for how realistic this is for me to restudy several thousands of cards. If I were to take a few examples of rescheduled cards and look at the metrics (Difficulty/Stability/Retention) what would I expect for their values for the most negative intervals? I'm also a bit confused as the field in the card browser on Anki calls R "Retention" but the equations page calls it "Retrievability". Are these the same R? If so I guess I would expect "Retrievability" to be very low for these cards correct?

Other than just a test sample of a few cards, what is the best metric to judge the model fitness for my particular data sets? I went through the colab for one of my decks (thanks for making that!) but didn't see any of the same simulation or plots when using the offline terminal method for generating the weights. Is there any way to see the R-squared or RMSE values/plots via the command line?

Also do you have any rule of thumb for what values are acceptable and what value ranges you would wait for further data on? I'm worried that since my learning intervals span all the way to 28 days on most of my deck options, this messes up some assumptions you make for building the model, but I could be wrong. I really like the idea of applying ML to this application so I'm quite motivated to make this work, but I'd just like to check that the fit is sufficient enough before trying to review thousands of cards :) Guessing there are some deck options or review history I could optimize better before just diving head first into the reviews.

@L-M-Sherlock
Copy link
Member

negative interval

They are not negative. Their intervals just are shorter than before. For example, -1000 means the new interval = old interval - 1000.

I'm also a bit confused as the field in the card browser on Anki calls R "Retention" but the equations page calls it "Retrievability".

They are the same thing for an individual card.

Is there any way to see the R-squared or RMSE values/plots via the command line?

image

Please set view graphs to y.

@L-M-Sherlock
Copy link
Member

Also do you have any rule of thumb for what values are acceptable and what value ranges you would wait for further data on?

You can share them in this issue. I can help you to check them.

@user1823
Copy link
Collaborator

negative interval

They are not negative. Their intervals just are shorter than before. For example, -1000 means the new interval = old interval - 1000.

Well, not exactly. -1000 means that FSRS predicts that the card should have been due 1000 days before today.

For an example, let's say that you last reviewed the card 1500 days back. Then, Anki gave it an interval of more than 1500 days because of which it was not due yet.

But, when you rescheduled your cards using FSRS helper, the algorithm predicted that your retrievability of the card would fall to your request retention in 500 days from that day. So, it made the interval as 500 days. But, now 1500 days have elapsed since then and so Anki shows that the card was due at the -1000 day (i.e. 1000 days before today).

If I were to take a few examples of rescheduled cards and look at the metrics (Difficulty/Stability/Retention) what would I expect for their values for the most negative intervals? ....... I guess I would expect "Retrievability" to be very low for these cards correct?

Yes, you got it right. But, how fast retrievability falls with time also depends upon the stability. So, lower the stability, faster is the decrease in the retrievability.

I'm worried that since my learning intervals span all the way to 28 days on most of my deck options, this messes up some assumptions you make for building the model.

It shouldn't affect the optimization process. But, you should reduce the learning steps after you begin using FSRS.

For more details, read the first answer here: https://github.com/open-spaced-repetition/fsrs4anki/wiki/FAQ

However, it is definitely possible that your revlogs have some abnormal elements that @L-M-Sherlock has not considered yet. Several users have reported such issues and @L-M-Sherlock has pushed patches for most (if not all) of them. So, if you are willing to do it, it might be a good idea to quickly check the D, S and R values of randomly sampled cards from your decks and see if they make sense to you or not.

By the way, @L-M-Sherlock, I noticed that this question (huge backlog after rescheduling) is not there in the FAQs. But, this question would come to the mind of most people who start using FSRS. So, I recommend you to add it to the FAQs.

@topherbuckley
Copy link
Author

Please set view graphs to y.

I did set that to y, but not seeing anything popup or saved to the working directory, or location of the package. Here is the full terminal history:

(.env) ~/git/fsrs4anki$ python -m fsrs4anki_optimizer decks/Kanji.apkg 
The defaults will switch to whatever you entered last.

Timezone list: https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568
input used timezone (default: America/New_York): 
input used next day start hour (default: 4): 
input the date at which before reviews will be ignored (default: 2006-10-05): 
input filter out suspended cards? (y/n) (default: y): 
View graphs? (y/n) (default: y): y
Deck file extracted successfully!
revlog.csv saved.
100%|██████████████████████████████████████████████████████████| 1234/1234 [00:00<00:00, 1327.14it/s]
Trainset saved.
Retention calculated.
100%|██████████████████████████████████████████████████████████| 2582/2582 [00:01<00:00, 2529.72it/s]
Stability calculated.
analysis: 100%|██████████████████████████████████████████████████| 134/134 [00:00<00:00, 1016.94it/s]
Analysis saved!
1:again, 2:hard, 3:good, 4:easy
            r_history  avg_interval  avg_retention  stability  factor  group_cnt
                    1           1.0          0.928        1.4     inf        668
                  1,3           1.1          0.974        4.8    3.43        614
                1,3,3           1.4          0.988       11.2    2.33        588
              1,3,3,3           2.5          0.988       18.7    1.67        562
            1,3,3,3,3           4.7          0.979       12.9    0.69        518
          1,3,3,3,3,3           4.9          0.970       13.0    1.01        437
        1,3,3,3,3,3,3           4.0          0.976       23.8    1.83        383
      1,3,3,3,3,3,3,3           5.9          0.978       23.9    1.00        330
    1,3,3,3,3,3,3,3,3          13.1          0.966       28.8    1.21        291
  1,3,3,3,3,3,3,3,3,3          30.8          0.900       21.4    0.74        247
1,3,3,3,3,3,3,3,3,3,3          62.5          0.832       25.5    1.19        173
                    3           1.0          0.963        2.8     inf        301
                  3,3           1.1          0.979        5.8    2.07        290
                3,3,3           1.5          0.976        8.5    1.47        280
              3,3,3,3           2.8          0.982       10.1    1.19        268
            3,3,3,3,3           5.3          0.975       14.2    1.41        249
          3,3,3,3,3,3           6.6          0.959       19.4    1.37        222
        3,3,3,3,3,3,3           6.3          0.983       31.7    1.63        188
      3,3,3,3,3,3,3,3          10.4          0.981       30.5    0.96        149
    3,3,3,3,3,3,3,3,3          21.7          0.960       28.2    0.92        130
  3,3,3,3,3,3,3,3,3,3          46.7          0.879       17.5    0.62        101
{1: 1.4357656523563398}
Not enough data for first rating 2. Expected at least 100, got 3.
{1: 1.4357656523563398, 3: 2.9245420735139076}
Not enough data for first rating 4. Expected at least 100, got 86.
Weighted fit parameters: [-9.89502528  3.43134217  1.43420661]
Fit stability: [1.43576565 2.92454207]
RMSE: 0.0000
Pretrain finished!
100%|████████████████████████████████████████████████████████| 12784/12784 [00:01<00:00, 6942.17it/s]
Tensorized!
TRAIN: 10038 TEST: 2746
dataset built
iteration: 4608                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9401, 0.9023, 0.9533, 0.0696, 1.4753, 0.2881, 0.9308, 2.4873, 0.01, 0.6595, 1.4804, 0.0606, 2.7038]
iteration: 9216                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9138, 0.8212, 1.0718, 0.0, 1.5009, 0.4011, 0.959, 2.484, 0.0363, 0.6487, 1.4796, 0.0, 2.838]
iteration: 13744                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8391, 0.7137, 1.163, 0.0, 1.5832, 0.4171, 1.0362, 2.4366, 0.0848, 0.6048, 1.4331, 0.0, 2.9537]
iteration: 18352                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7949, 0.6446, 1.2779, 0.0, 1.6547, 0.4265, 1.1009, 2.4265, 0.0949, 0.5946, 1.4139, 0.0, 3.01]
iteration: 22880                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7424, 0.5734, 1.2817, 0.0397, 1.7143, 0.4093, 1.1534, 2.4589, 0.0629, 0.6321, 1.4457, 0.0, 3.1079]
iteration: 27488                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7666, 0.5659, 1.3482, 0.0033, 1.6965, 0.4736, 1.1383, 2.4441, 0.078, 0.6178, 1.4321, 0.0, 3.1598]
iteration: 32016                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.788, 0.5761, 1.3991, 0.0, 1.6834, 0.5141, 1.1263, 2.4218, 0.1, 0.5959, 1.415, 0.0, 3.1864]
iteration: 36624                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7881, 0.5791, 1.4119, 0.0042, 1.6881, 0.5239, 1.1301, 2.4158, 0.1062, 0.5906, 1.4091, 0.0, 3.2081]
iteration: 41152                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7745, 0.5654, 1.4025, 0.0161, 1.7023, 0.5158, 1.1426, 2.4288, 0.0936, 0.6041, 1.4242, 0.0014, 3.2124]
iteration: 45760                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7691, 0.5601, 1.3999, 0.0189, 1.7082, 0.512, 1.1478, 2.4322, 0.0902, 0.6077, 1.4281, 0.002, 3.2155]
train: 100%|████████████████████████████████████████████████| 48240/48240 [00:02<00:00, 16680.27it/s]
TRAIN: 10101 TEST: 2683
dataset built
iteration: 4608                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.8694, 0.8035, 0.8745, 0.0166, 1.5416, 0.3319, 0.9926, 2.2431, 0.0388, 0.3934, 1.364, 0.0582, 2.5296]
iteration: 9216                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9164, 0.782, 0.9467, 0.0, 1.5049, 0.44, 0.9575, 2.4207, 0.01, 0.5683, 1.5454, 0.0, 2.6299]
iteration: 13651                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8979, 0.685, 1.0391, 0.0, 1.5338, 0.4627, 0.9872, 2.4502, 0.0164, 0.6014, 1.5901, 0.0, 2.7144]
iteration: 18259                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8143, 0.5527, 1.1065, 0.0, 1.6341, 0.4161, 1.0881, 2.4673, 0.01, 0.6116, 1.6125, 0.0, 2.8241]
iteration: 22694                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8467, 0.5483, 1.2021, 0.0, 1.618, 0.4717, 1.0748, 2.4412, 0.0486, 0.5807, 1.5868, 0.0, 2.8465]
iteration: 27302                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8418, 0.5318, 1.2653, 0.0, 1.6426, 0.476, 1.0982, 2.4168, 0.0732, 0.5531, 1.571, 0.0, 2.9001]
iteration: 31737                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8219, 0.4956, 1.292, 0.0, 1.673, 0.4648, 1.1267, 2.4409, 0.0487, 0.5766, 1.6034, 0.0, 2.9466]
iteration: 36345                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8232, 0.4854, 1.3175, 0.0, 1.6807, 0.465, 1.1337, 2.447, 0.0422, 0.5822, 1.6134, 0.0, 2.9666]
iteration: 40780                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8221, 0.4826, 1.323, 0.0, 1.6835, 0.4662, 1.1361, 2.4458, 0.0434, 0.5805, 1.614, 0.0, 2.967]
iteration: 45388                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.822, 0.4823, 1.3236, 0.0, 1.6839, 0.4665, 1.1364, 2.446, 0.0432, 0.5807, 1.6143, 0.0, 2.9677]
train: 100%|████████████████████████████████████████████████| 45215/45215 [00:02<00:00, 19613.96it/s]
TRAIN: 10371 TEST: 2413
dataset built
iteration: 4608                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9716, 0.9471, 0.856, 0.1396, 1.4522, 0.3296, 0.9072, 2.3105, 0.01, 0.4654, 1.4287, 0.0605, 2.8655]
iteration: 9216                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9682, 0.8583, 0.9004, 0.1193, 1.4434, 0.4652, 0.9007, 2.3926, 0.01, 0.55, 1.5238, 0.0, 3.0193]
iteration: 13412                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.9243, 0.7743, 0.993, 0.0633, 1.4993, 0.4974, 0.9553, 2.3859, 0.0338, 0.5492, 1.5269, 0.0, 3.1758]
iteration: 18020                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8389, 0.6539, 1.062, 0.022, 1.6, 0.4667, 1.0496, 2.3707, 0.0508, 0.5343, 1.5101, 0.0, 3.2895]
iteration: 22216                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7737, 0.5538, 1.0704, 0.0417, 1.6707, 0.4378, 1.1143, 2.4408, 0.0119, 0.6059, 1.5793, 0.0, 3.3584]
iteration: 26824                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7966, 0.5469, 1.1657, 0.0, 1.6611, 0.4914, 1.1074, 2.4041, 0.0489, 0.5724, 1.5557, 0.0, 3.4083]
iteration: 31020                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.814, 0.555, 1.2326, 0.0, 1.659, 0.519, 1.1055, 2.3851, 0.0687, 0.5519, 1.5367, 0.0, 3.4588]
iteration: 35628                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8173, 0.5506, 1.272, 0.0061, 1.668, 0.5223, 1.1131, 2.3803, 0.0737, 0.5479, 1.5324, 0.0, 3.4839]
iteration: 39824                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8061, 0.537, 1.267, 0.016, 1.6808, 0.5135, 1.1242, 2.3965, 0.0573, 0.5643, 1.5506, 0.0007, 3.5028]
iteration: 44432                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8021, 0.5325, 1.2653, 0.018, 1.6852, 0.5108, 1.128, 2.402, 0.0518, 0.5698, 1.5561, 0.0004, 3.5085]
train: 100%|████████████████████████████████████████████████| 46580/46580 [00:02<00:00, 18921.23it/s]
TRAIN: 10313 TEST: 2471
dataset built
iteration: 4608                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9425, 0.897, 0.956, 0.122, 1.4932, 0.2626, 0.9453, 2.3013, 0.01, 0.4623, 1.4156, 0.0278, 2.717]
iteration: 9216                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9795, 0.8269, 1.0464, 0.0759, 1.4374, 0.4292, 0.8954, 2.4004, 0.01, 0.5466, 1.5133, 0.0, 2.8489]
iteration: 13652                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.9423, 0.7284, 1.1658, 0.0042, 1.4836, 0.4722, 0.9432, 2.428, 0.0143, 0.568, 1.5267, 0.0, 2.9741]
iteration: 18260                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.863, 0.6199, 1.2535, 0.0209, 1.5842, 0.4349, 1.0412, 2.441, 0.0176, 0.5725, 1.5112, 0.0, 3.0635]
iteration: 22696                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8231, 0.5459, 1.31, 0.0, 1.6324, 0.4242, 1.0871, 2.4753, 0.0153, 0.6064, 1.5494, 0.0, 3.2084]
iteration: 27304                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8267, 0.5174, 1.3899, 0.0, 1.6395, 0.4518, 1.0943, 2.4625, 0.0285, 0.5917, 1.5349, 0.0, 3.2875]
iteration: 31740                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8366, 0.518, 1.4425, 0.0, 1.6394, 0.4733, 1.094, 2.4398, 0.0513, 0.5677, 1.5136, 0.0, 3.3179]
iteration: 36348                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8456, 0.5288, 1.4605, 0.0051, 1.6341, 0.491, 1.0889, 2.4328, 0.0586, 0.56, 1.5067, 0.0, 3.336]
iteration: 40784                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8376, 0.5192, 1.4535, 0.0151, 1.6415, 0.4873, 1.0953, 2.4452, 0.0462, 0.5728, 1.5222, 0.0, 3.3479]
iteration: 45392                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8339, 0.5149, 1.451, 0.0168, 1.645, 0.4854, 1.0983, 2.4489, 0.0425, 0.5766, 1.5264, 0.0, 3.3533]
train: 100%|████████████████████████████████████████████████| 47780/47780 [00:02<00:00, 19776.53it/s]
TRAIN: 10313 TEST: 2471
dataset built
iteration: 4608                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.943, 0.9064, 0.7765, 0.1706, 1.4457, 0.322, 0.8982, 2.3988, 0.01, 0.5501, 1.4743, 0.0323, 2.6913]
iteration: 9216                                                                                      
w: [1.44, 1.48, 2.92, 30.0, 4.9295, 0.7769, 0.7719, 0.2043, 1.4328, 0.4688, 0.8882, 2.4561, 0.0188, 0.5896, 1.5344, 0.0, 2.8107]
iteration: 13437                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.8561, 0.6451, 0.7981, 0.2144, 1.502, 0.5157, 0.9564, 2.3974, 0.0762, 0.5224, 1.4856, 0.0, 2.9019]
iteration: 18045                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7863, 0.5423, 0.8244, 0.2149, 1.5735, 0.5283, 1.0235, 2.3941, 0.0784, 0.505, 1.4924, 0.0, 2.9453]
iteration: 22266                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7284, 0.482, 0.8372, 0.215, 1.6359, 0.5164, 1.0794, 2.4465, 0.0281, 0.5552, 1.5564, 0.0, 3.0533]
iteration: 26874                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7113, 0.4381, 0.8608, 0.2036, 1.6539, 0.5452, 1.0952, 2.4403, 0.0347, 0.5444, 1.5678, 0.0, 3.1044]
iteration: 31095                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.719, 0.4171, 0.8869, 0.1885, 1.6454, 0.5833, 1.0876, 2.4222, 0.052, 0.5217, 1.5544, 0.0, 3.1302]
iteration: 35703                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7212, 0.4056, 0.9044, 0.1766, 1.6439, 0.6009, 1.0859, 2.4151, 0.0588, 0.5116, 1.5483, 0.0, 3.1504]
iteration: 39924                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7179, 0.3985, 0.9076, 0.1729, 1.6474, 0.6052, 1.0886, 2.4209, 0.0534, 0.5175, 1.5607, 0.0, 3.1535]
iteration: 44532                                                                                     
w: [1.44, 1.48, 2.92, 30.0, 4.7146, 0.395, 0.9082, 0.1725, 1.6511, 0.6038, 1.0917, 2.4242, 0.0502, 0.5208, 1.5653, 0.0, 3.1572]
train: 100%|████████████████████████████████████████████████| 46705/46705 [00:02<00:00, 19101.78it/s]

Training finished!
prediction.tsv saved.
average time for failed cards: 106.0s
average time for recalled cards: 11.8s
terminal stability:  231.10
find optimal retention: 100%|████████████████████████████████████████| 15/15 [00:18<00:00,  1.24s/it]
expected_time.csv saved.

-----suggested retention (experimental): 0.71-----
Paste this into your scheduling code
{
    // Generated, Optimized anki deck settings
    "deckName": "decks/Kanji.apkg",// PLEASE CHANGE THIS TO THE DECKS PROPER NAME
    "w": [1.44, 1.48, 2.92, 30.0, 4.7891, 0.4994, 1.2556, 0.0381, 1.6698, 0.5067, 1.1165, 2.4327, 0.0534, 0.5731, 1.5381, 0.0001, 3.2201],
    "requestRetention": 0.709820087609512,
    "maximumInterval": 36500,
},

R-squared: 0.8340
RMSE: 0.0230
MAE: 0.0132
[-0.108172    1.11618643]

Last rating: 1
R-squared: 0.5342
RMSE: 0.0147
MAE: 0.0096
[0.32685374 0.65151339]

Last rating: 2
R-squared: -0.0254
RMSE: 0.0792
MAE: 0.0660
[-0.06219075  1.01491089]

Last rating: 3
R-squared: 0.8673
RMSE: 0.0212
MAE: 0.0145
[-0.24696684  1.26406213]

Last rating: 4
R-squared: -3.7242
RMSE: 0.1276
MAE: 0.0935
[0.6505713  0.34437975]
Loss of SM-2: 0.3090
R-squared: -13.2252
RMSE: 0.0876
MAE: 0.0508
[0.87980625 0.07024541]
Universal Metric of FSRS: 0.0156
Universal Metric of SM2: 0.0724

Here is the pip list from my virtual environment.

(.env) ~/git/fsrs4anki$ pip list
Package                  Version
------------------------ ----------
cmake                    3.27.0
contourpy                1.1.0
cycler                   0.11.0
filelock                 3.12.2
fonttools                4.41.1
fsrs4anki-optimizer      4.3.2
Jinja2                   3.1.2
joblib                   1.3.1
kiwisolver               1.4.4
lit                      16.0.6
MarkupSafe               2.1.3
matplotlib               3.7.2
mpmath                   1.3.0
networkx                 3.1
numpy                    1.25.1
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-cupti-cu11   11.7.101
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
nvidia-cufft-cu11        10.9.0.58
nvidia-curand-cu11       10.2.10.91
nvidia-cusolver-cu11     11.4.0.1
nvidia-cusparse-cu11     11.7.4.91
nvidia-nccl-cu11         2.14.3
nvidia-nvtx-cu11         11.7.91
packaging                23.1
pandas                   2.0.3
patsy                    0.5.3
Pillow                   10.0.0
pip                      22.0.2
pyparsing                3.0.9
python-dateutil          2.8.2
pytz                     2023.3
scikit-learn             1.3.0
scipy                    1.11.1
setuptools               59.6.0
six                      1.16.0
statsmodels              0.14.0
sympy                    1.12
threadpoolctl            3.2.0
torch                    2.0.1
tqdm                     4.65.0
triton                   2.0.0
typing_extensions        4.7.1
tzdata                   2023.3
wheel                    0.41.0

and python info:

(.env) ~/git/fsrs4anki$ python -V
Python 3.10.6

I'm on Ubuntu 22.04 if that makes any difference as well.

I installed fsrs4anki-optimizer from pip, but tried running this code in pdb, but looks like you remove the package directory in a recent commit. Should we move this issue over to the new repo?

From stepping through in pdb, it looks like this might be the root cause:

Stepping in here (Although I'm on commit 9fa23d1 still), I'm seeing:

(Pdb) s
--Call--
> /media/christopher/HDD/git/fsrs4anki/.env/lib/python3.10/site-packages/matplotlib/figure.py(2702)show()
-> def show(self, warn=True):
(Pdb) n
> /media/christopher/HDD/git/fsrs4anki/.env/lib/python3.10/site-packages/matplotlib/figure.py(2736)show()
-> if self.canvas.manager is None:
(Pdb) n
> /media/christopher/HDD/git/fsrs4anki/.env/lib/python3.10/site-packages/matplotlib/figure.py(2740)show()
-> try:
(Pdb) n
> /media/christopher/HDD/git/fsrs4anki/.env/lib/python3.10/site-packages/matplotlib/figure.py(2741)show()
-> self.canvas.manager.show()
(Pdb) n
matplotlib.backend_bases.NonGuiException: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

I'm not familiar with agg, but one possible workaround (and my preference) would be to use plt.savefig so I can take a look at them more than one at a time, and can have them for future reference. Would that be problematic? I can just change a forked/local copy to change out that one line if thats not something you'd want included in the code for some reason. Or maybe a terminal flag to default to how you have it but -w for write plot files to local directory or something?

@L-M-Sherlock
Copy link
Member

@topherbuckley you can see the figures saved in local directory with the latest optimizer now.

@L-M-Sherlock
Copy link
Member

And the huge backlog is partially induced by the set due date. Rescheduling calculated new intervals for those cards whose intervals were manually scheduled to future.

@jake0216
Copy link

jake0216 commented Aug 2, 2023

I have had a similar issue. I run the optimizer each month and get a backlog of 300+ cards each time. I have ~7100 cards in rotation for this deck, with some of the cards 2+ years old. I have the weights and decks from each month I have done the optimizer if that helps.

@topherbuckley
Copy link
Author

@topherbuckley you can see the figures saved in local directory with the latest optimizer now.

Yep! Thanks for adding that functionality. I think that makes for a much better UX.

And the huge backlog is partially induced by the set due date. Rescheduling calculated new intervals for those cards whose intervals were manually scheduled to future.

I see, thanks for finding that. I can't imagine it accounts for everything though. I'm sure I didn't manually reschedule thousands of cards. I may have reschedules somewhere between 20-50 cards like that if I had to guess. You have my collection for testing if you have the time and want to put further effort towards this, but I can totally understand that you can't handle every individual case, so just update me here if you ever get around to finding any other causes for this.

@L-M-Sherlock
Copy link
Member

I see, thanks for finding that. I can't imagine it accounts for everything though. I'm sure I didn't manually reschedule thousands of cards. I may have reschedules somewhere between 20-50 cards like that if I had to guess. You have my collection for testing if you have the time and want to put further effort towards this, but I can totally understand that you can't handle every individual case, so just update me here if you ever get around to finding any other causes for this.

But I found 826 cards whose intervals are longer than the intervals recorded in review logs.

@perhydrol
Copy link

perhydrol commented Aug 13, 2023

I've been using fsrs v4 for a while, and I've also generated my own parameters. Also, I use Reschedule all cards every day. But I'm weird, every time I use Reschedule all cards it generates new backlog cards, even though I cleared all cards yesterday. Even rescheduling at different times of the day can have different results. Does this mean I need to update the parameters or should not use Reschedule all cards every day?

@user1823
Copy link
Collaborator

Potential cause: open-spaced-repetition/fsrs4anki-helper#173 (comment)

@perhydrol
Copy link

Thanks, I just browsed it. I don't seem to fit these situations well, I'm using the latest plugin, and my steps are as shown below. The reason why I have this question is because according to the arrangement of the plug-in, I didn't have any review plan two days ago, but when I rescheduled today, it suddenly showed that I should review 10 cards two days ago. I didn't change anything during this time. I just browsed Sherlock's answer in the Chinese community, often Reschedule all cards is no problem, although he recommends only for the first use and every time the parameters are updated. In order to pass the exam, maybe I should follow the Reschedule all cards and clear it.
图片

@L-M-Sherlock
Copy link
Member

But I'm weird, every time I use Reschedule all cards it generates new backlog cards, even though I cleared all cards yesterday.

Do you enable load balance or other features? And could you provide your add-on list?

@perhydrol
Copy link

perhydrol commented Aug 13, 2023

Yes, I have everything enabled: auto reschedule after sync, auto disperse siblings (all my cards are standard question/answer), load balancing. My list of plugins is: AnkiConnect (just for auto-generating cards from Obsidian notes), FSRS4Anki helper.
Sorry, my previous description was not accurate, sometimes it was a backlog, and sometimes it was scheduling cards into the future. But today's arrangement is too different from two days ago, which led to my doubts.

@L-M-Sherlock
Copy link
Member

I think it is the same problem in issue:

Could you disable load balance and reschedule all cards again?

@perhydrol
Copy link

I think it is the same problem in issue:

* [[BUG] Strange behaviour when rescheduling cards fsrs4anki-helper#116](https://github.com/open-spaced-repetition/fsrs4anki-helper/issues/116)

Could you disable load balance and reschedule all cards again?

The situation is exactly the same. I think it should be caused by this.
Snipaste_2023-08-13_10-37-01
Snipaste_2023-08-13_10-37-41

@L-M-Sherlock
Copy link
Member

OK. I plan to fix it today. Thanks for your time.

@L-M-Sherlock
Copy link
Member

Patch: fsrs4anki-helper.zip
@perhydrol please install this patch.

@perhydrol
Copy link

Thanks. It works.
图片

@L-M-Sherlock
Copy link
Member

L-M-Sherlock commented Aug 13, 2023

But the graph isn't smooth. Is it the stats for global collection?

Let's continue in open-spaced-repetition/fsrs4anki-helper#116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants