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

Parameters for individual decks don't work #41

Closed
Expertium opened this issue Sep 28, 2022 · 22 comments
Closed

Parameters for individual decks don't work #41

Expertium opened this issue Sep 28, 2022 · 22 comments
Labels
compatibility Incompatible with other add-ons

Comments

@Expertium
Copy link
Collaborator

Expertium commented Sep 28, 2022

Describe the bug
You can specify parameters for each deck, but right now only global parameters affect scheduling.

To Reproduce
Steps to reproduce the behavior:

  1. Go to deck options and post code from fsrs4anki_scheduler.js in the window at the bottom of the settings
  2. Add this chunk:
if (document.getElementById('deck') !== null) {

    const deck_name = document.getElementById('deck').innerHTML;
    // parameters for a specific deck
    if (deck_name == "DeckName") {
        var f_s = [0.7712,0.837];
        var f_d = [1.0018,-0.9006,-1.1375,0.0935];
        var s_w = [3.0531,-0.8949,-0.1383,1.3434,2.1846,-0.2868,0.4257,1.245];

        requestRetention = 0.80;
        maximumInterval = 3650;
        easyBonus = 1.5;
        hardInterval = 1.2;
    }
}
  1. Try doing reviews with the above piece of code and without it (with global parameters)
  2. Compare the intervals, they should be different since the parameters are different

Expected behavior
Different sets of parameters should produce different intervals.

Environment

  • Anki version: 2.1.55
  • OS: Windows 10
  • Scheduler version: v2.0.3
  • Optimizer version: v2.0.3

Additional context
Here's all of my code:
code.txt

@Expertium Expertium added the bug Something isn't working label Sep 28, 2022
@L-M-Sherlock
Copy link
Member

Can you open the inspector and run the code to this line? It will show the deck name that the code actually fetchs.

image

@Expertium
Copy link
Collaborator Author

Yep, it uses the correct deck name, but not the correct parameters.
1

@L-M-Sherlock
Copy link
Member

Was var f_s = [0.7249,0.8026] skipped?

@Expertium
Copy link
Collaborator Author

My global parameters are

var f_s = [0.4112,1.5968];
var f_d = [1.0199,-0.4685,-1.7075,0.0714];
var s_w = [3.5014,-1.3554,-0.138,1.7324,2.9985,-0.0531,0.9896,1.3442];

My parameters for that deck are:

var f_s = [0.7249,0.8026];
var f_d = [1.0007,-0.6561,-1.2081,0.0112];
var s_w = [3.2511,-0.8703,-0.0277,1.5211,2.1651,-0.2846,0.5221,1.2443]

"Scope" shows the wrong parameters, but the right deck name.
1

I'm using scheduler v2.0.3

@L-M-Sherlock
Copy link
Member

Can you step over the line 31-38, then to check the scope?

@Expertium
Copy link
Collaborator Author

image

@L-M-Sherlock
Copy link
Member

image

So the parameters have been set. Any other problem?

@Expertium
Copy link
Collaborator Author

Huh, weird. I'll test it a bit more later, now that I've disabled button king add-on.

@Expertium
Copy link
Collaborator Author

Expertium commented Sep 29, 2022

Well, at this point I'm just confused. I tried enabling and disabling "the king of button add-ons", tried removing the code entirely, and no matter what I do the intervals don't change. Take a look at screenshots - the intervals are the same no matter what. I made sure that V3 scheduler is enabled, restarted Anki every time, etc. I tried using new code (v2.1.0) instead of 2.0.3, nope, still doesn't work.
image

@L-M-Sherlock
Copy link
Member

L-M-Sherlock commented Sep 29, 2022

Can you follow these actions in this GIF?

debug

I need easy_interval, good_interval and hard_interval in your case.

@Expertium
Copy link
Collaborator Author

Here
image
I once again tried enabling and disabling "the king of button add-ons", it doesn't make a difference.

@L-M-Sherlock
Copy link
Member

I add a new example of setting parameters for a specific deck:

image

@Expertium
Copy link
Collaborator Author

Expertium commented Sep 29, 2022

image
image
Nope, intervals still don't change, no matter what parameters I use and no matter whether I even use code from fsrs4anki_scheduler.js.
This stuff did change though, but not the intervals that are displayed
image

@L-M-Sherlock
Copy link
Member

Do you click show answer before the code run to the end?

@L-M-Sherlock
Copy link
Member

You can click the blue arrow to run to the end of the code. Then you click the show answer, and the interval may be different.
image

@Expertium
Copy link
Collaborator Author

Nope, still the same.

@L-M-Sherlock
Copy link
Member

So weird😭.

@Expertium
Copy link
Collaborator Author

Expertium commented Sep 29, 2022

Do you not have the same issue?
I have one last idea in mind - I'll try disabling every single add-on, and see if that helps.

@Expertium
Copy link
Collaborator Author

Expertium commented Sep 29, 2022

image
Ok, I'm getting somewhere. I will turn add-ons on one-by-one, and see if maybe one of them breaks the whole thing (seems like that's what's happening)

@L-M-Sherlock
Copy link
Member

I'm looking forward to your good news!

@Expertium
Copy link
Collaborator Author

Expertium commented Sep 29, 2022

image

Alright, so this does change something. Deck-specific parameters still don't work though, even now. OR maybe it just so happened that both global and deck-specific parameters produced the same result. Frankly, I don't know how sensitive intervals are to changes in parameters. Ok, after a bit of testing with different parameters, I think we were fighting a non-existent problem - I think both global parameters and deck-specific parameters just happened to produce (roughly) the same intervals for that card of mine. That also means that it's probably unnecessary to optimize each deck individually, global parameters are probably good enough, aside from some crazy hard or crazy easy decks. We need some kind of sensitivity analysis, like "If I change this parameter by 5%, how much will the interval change?", that sort of thing.
I'll try to enable add-ons back one-by-one.

Aaaaaaaaaaaand the culprit is...Incremental Reading v4.11.3 (unofficial clone).
Ok, so we weren't fighting a non-issue, both this AND the fact that changing parameters seems to only slightly affect intervals were simultaneously causing confusion. God damn incremental reading man, I personally reported like 3-5 bugs for that add-on, what a pain.

Add-ons that don't cause problems:
Advanced Browser
Anki forvo-dl - Forvo Pronunciation Downloader fully automatic
AnkiConnect
AnkiWebView Inspector
CrowdAnki JSON export&import Edit history Collaborate on deck creation.
Enhanced Cloze for Anki 41
export cards/notes from browser with metadata to csv or xlsx
Export in CSV format
Extended Card Stats During Review
Image Occlusion Enhanced
Image Style Editor
Progress Graphs and Stats for Learned and Matured Cards
Quantified Self add-on - export your review log (fork for Anki 2.1)
Remove Duplicate Cards
Review Heatmap
True Retention
The KING of Button Add-ons

Well, at least now you can add these to the list of addons that are compatible with FSRS (or, rather, to the "These seem to work at first glance and don't immediately make the new algorithm shit itself" list). And yes, The King of Buttonf Add-ons doesn't interfere with FSRS, it seems.

@L-M-Sherlock L-M-Sherlock added compatibility Incompatible with other add-ons and removed bug Something isn't working labels Sep 29, 2022
@L-M-Sherlock
Copy link
Member

I add the incompatible add-ons to the list at Compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Incompatible with other add-ons
Projects
None yet
Development

No branches or pull requests

2 participants