Has anyone done a live comparison of FSRS and SM2 as implemented in Anki? (It looks like no, so can anyone help me set it up?)

With the new version coming out soon, and FSRS being supported natively, I wanted to see if anyone had results about the difference. Has anyone randomly divided their cards and had half running on FSRS and half on the default (SM2?) v3 scheduler? (All within the same collection, to try to control for differences in people, what they’re studying, different types of cards, different ages of cards, times of year , which one was studied first, etc.)

If the answer is no, how hard would it be for me to adjust the custom scheduling code to work on a random half of my collection (maybe based on the last couple digits of the card ID?) and then separate out the data in a few months to a year?

I know there’s plenty of examples of comparisons based on the review history of a collection, but as I understand it those collections would have either been all using SM2 or all using FSRS. I’d like to see a live randomized comparison to convince myself that those results hold up in practice.

3 Likes

The FSRS has only been publicly available for about one year, so I don’t think those long term data are available. Also, it seems difficult to simply compare Spaced Repetition algorithms, so even if someone were to do that, perhaps the sample size is not enough.

Simply put, Anki’s SM2 is about 30 years old algorithm, SuperMemo’s SM18 is the best performing, FSRS4 is quite similar to SM17 (SM18 is closed so no comparison).

According to SuperMemo, SM17 is considerably superior to SM2, so there is little doubt that FSRS is superior to SM2.

There are several algorithmic comparisons.


5 algorithms

fsrs_explained_part_2_accuracy


FSRS vs SM15
image
Total users: 16,Total repetitions: 257,077, Smaller is better.

fsrs-vs-sm15
fsrs4anki/wiki/The-Benchmark


FSRS vs SM17
image
Total users: 16, Total repetitions: 194,281, Smaller is better.

[ Why not SM-18? ] Due to the limitation of SuperMemo 18, I can’t export the predictions of SM-18. So I can’t compare SM-18 with FSRS. If you know how to export the predictions of SM-18, please let me know.

fsrs-vs-sm17


Comparison of 35 algorithms
Currently proposed universal metric shows an overwhelming superiority of Algorithm SM-17 over other simple propositions.

Here is a preliminary estimate for an exemplary set of 700,000 repetitions:

image

supermemo.guru/ Comparison_of_35_algorithms


3 Likes

Thank you. I had already read all of those except the last one. They are interesting, but I still want a live comparison - a randomly selected half of the same person’s collection over the same time period - with, effectively, the two options I will have when the new version of Anki comes out. A demonstration, to convince myself of the results.

FSRS has already been out for about a year already, so I thought someone might have already done it, which is why I asked.

I am also unfamiliar with how the custom scheduling works (both in general and the specific code for FSRS before the natively-integrated version comes out), which is why I asked how hard it would be to set up to run on a random half of the collection (in such a way that data can be sorted out later) so that, if this doesn’t already exist, I can try it over the next several months to a year and report back.

(I know it is possible to set the custom scheduling code so that the FSRS scheduling runs on some decks while excluding other decks, which is why I’m hopeful it’s possible and reasonably straightforward to run it on a random -ish sample of my collection. And I’m not willing to mess up my deck structure to put a random half of the new cards I create in decks based on which scheduler I want them to use.)

1 Like

Okay, I took a brief look at the custom scheduling javascript, and did some brief tests, and came to the conclusion that I don’t know enough yet to be able to set this demonstration/test up myself.

The easy part appears to be skipping FSRS to use the default scheduler, if you know what criteria to use: it’s just to break/return out of the custom scheduling before anything happens (like you do for the decks you want to skip - line 73 as of this writing, here: https://github.com/open-spaced-repetition/fsrs4anki/blob/main/fsrs4anki_scheduler.js).

The tricky part is to figure out what criteria to use to skip a card.

In my half-baked idea for how to set up my collection for this comparison, I wanted to access the card ID in some way from the custom scheduler to use the last few digits (assuming the last few digits are random enough, and that the card ID won’t change) to choose whether to use FSRS or the default scheduler, and then to be able to search for it using wildcards later to sort out the stats.

However, as far as I can tell, you can’t do either part:

  • you can’t access the card ID in any way from the custom scheduler:
    • ctx (which I don’t fully understand) only has seed and deckName
    • the workaround of putting something on all my card templates ( <span id="special-thing">{{special-thing}}</span>) falls apart because none of the special fields here seem to be useful for my card randomization: Field Replacements - Anki Manual
  • you can’t search for cid:*2, or all the cards with ids ending in an even number, or something, which makes getting stats at the end LOT harder
    • maybe there’s a way to do it if I analyze the .apkg or .colpkg file separately

So, this brings me to my questions (if you have answers to only some, that’s great, I do want answers to all of them but even some of them will help):

  • What is ctx?
    • How is the seed generated? [answered: (card ID << 8 sort of) + number of reviews]
    • Under what circumstances would the seed change? (I’m hoping the answer is none) [answered]
    • Is there a way to search for cards by seed, or by partial match to seed? (Either within Anki, or by analyzing the apkg/colpkg after the fact.) [indirectly answered]
    • What would it take to add something else to ctx?
  • Is there a way to make the last few digits of the card ID work for this?
    • firstly, to get access to it in the custom scheduling (needs to work on desktop AND ankiMobile)? [partially answered: it’s a component of ctx.seed… follow up questions below]
    • secondly, since I’ve never done a dive into the database structure, is it possible to use some outside tool to analyze the apkg or something in order to split the statistics at the end of this demonstration/test in the same way it would have been split in the custom scheduling? [answered my own question - I did some stuff with ankiconnect that seems like it’ll work - see new post below]
  • Is there something that I’ve overlooked that I could use instead to make this demonstration/test work? [partially answered - customData? more questions below]
1 Like

The seed is cid.rotate_left(8).add(reps).

1 Like

Thank you!

So, if I’m assuming assuming the card IDs are small enough (pretty sure they are?) and there are fewer than 256 reviews, I can get the card ID from ctx.seed>>8 (with some experimentation, it looks like ctx.seed/256, maybe rounded down, will be better - I don’t understand javascript giving me different results for those). Does that seem correct? Is the formula for the seed likely to change at any point?

Also I’m not sure if the <256 reviews thing is a safe assumption though, for me or for FSRS in general (still don’t understand how they use the seed so it may be a non-issue for FSRS.) I have only one card that is close - 212 reviews, there were only 8 lapses, it’s only a year old - but I’ve only been using Anki for a few years, I’d be surprised if longer-term/heavier users than me didn’t have some cards with 256+ reviews.

If I remember correctly, card ids are just time stamps from the beginning of the epoch

Okay! I wrote a script using Python + ankiconnect that sorts all my cards by even and odd card IDs into two decks. The stats look similar enough: 22102 odd cards, 22100 even cards. So that sorts out part 2. We might lose some data based on what deck it’s in/what kind of card it is, but I might be able to sort that out later too with ankiconnect. This is coming together!

I’m currently editing the custom scheduling code to suit my purposes, and I have another question:

  • what is customData?
    • I should be able to just add some info to it, and then access that info on future reviews, is that correct?
    • so I can convert the seed into the card id (or close enough, anyways), and add it to customData, and then access it from there so I don’t have to do that calculations on future cards, is that correct?

customData is a field of the card table. You can save necessary info in it, but don’t store too many things. Anki supports search string and number stored in customData via prop:cdn:key=value.

1 Like

Okay.
I also took a look at the distribution where I did the card ID mod 3. It’s possibly got some bias, but it’s close enough to random that I’m happy with this for demonstration purposes.

With data from sometime on October 12, I ran the optimizer here Google Colab for my weights on my whole collection, and then on language cards vs trivia cards

Whole collection weights: [0.5317, 1.4336, 3.0735, 29.2601, 3.7603, 2.1585, 2.2375, 0.0006, 1.3592, 0.1098, 1.4773, 1.5683, 0.1349, 0.367, 1.9989, 0.3155, 6.9208]
Language weights: [0.6436, 2.9047, 3.8645, 22.5929, 5.1363, 1.6328, 1.5416, 0.0051, 1.4432, 0.1, 1.0946, 2.0075, 0.1539, 0.3865, 1.9886, 0.2838, 6.3841],
Trivia weights: [0.7127, 2.1688, 4.8475, 27.7297, 3.2037, 2.0675, 2.0751, 0.0, 1.5099, 0.1522, 1.3569, 1.7759, 0.1379, 0.3721, 1.9932, 0.2681, 8.269]

Since the weights look pretty different from default (although I don’t know how different it’ll actually be in practice), and I’m curious to know how much it’ll actually affect things, I rolled a die and said:
FSRS default weights for card IDs = 0 mod 3
SM2 for card IDs = 1 mod 3
FSRS trained weights = 2 mod 3

I have all the pieces I need, so I’m moving forward with this.

Starting with all my reviews on October 13, I’m running with the custom study code that I think will do what I’m trying to do, and if everything goes well/nothing goes wrong, I’ll report back in a month (maybe), a few months, and a year about how things compare.

I’m skipping the initial rescheduling part.

Here’s the untested modified custom study code I’m using; I may edit it if I run into issues in the next few days. If anyone wants to take a look and see if it’s doing what I think it’s doing, I’d really appreciate it, but also even if no one reviews this I’m going to go for it and see what happens. Worst case scenario, I give up and in a couple months I’m asking how to clear customData.

(I added the stuff at the beginning because my learning steps are 10m, 12h, 10m, 12h. I moved some stuff around to accommodate selecting weights differently as well.)

// Personal code: 
// makes the hard learning step equal to the good learning step if it's more.
if(states.hard.normal && states.hard.normal.learning && states.good.normal && states.good.normal.learning && states.hard.normal.learning.scheduledSecs > states.good.normal.learning.scheduledSecs) {
  states.hard.normal.learning.scheduledSecs = states.good.normal.learning.scheduledSecs;
}
if(states.hard.normal && states.hard.normal.relearning && states.hard.normal.relearning.learning && states.good.normal && states.good.normal.relearning && states.good.normal.relearning.learning && states.hard.normal.relearning.learning.scheduledSecs > states.good.normal.relearning.learning.scheduledSecs) {
  states.hard.normal.relearning.learning.scheduledSecs = states.good.normal.relearning.learning.scheduledSecs;
}
if(states.hard.filtered && states.hard.filtered.rescheduling && states.hard.filtered.rescheduling.originalState && states.hard.filtered.rescheduling.originalState.learning &&  states.good.filtered && states.good.filtered.rescheduling && states.good.filtered.rescheduling.originalState && states.good.filtered.rescheduling.originalState.learning && states.hard.filtered.rescheduling.originalState.learning.scheduledSecs > states.good.filtered.rescheduling.originalState.learning.scheduledSecs) {
  states.hard.filtered.rescheduling.originalState.learning.scheduledSecs = states.good.filtered.rescheduling.originalState.learning.scheduledSecs;
}
if(states.hard.filtered && states.hard.filtered.rescheduling && states.hard.filtered.rescheduling.originalState && states.hard.filtered.rescheduling.originalState.relearning && states.hard.filtered.rescheduling.originalState.relearning.learning &&  states.good.filtered && states.good.filtered.rescheduling && states.good.filtered.rescheduling.originalState && states.good.filtered.rescheduling.originalState.relearning && states.good.filtered.rescheduling.originalState.relearning.learning && states.hard.filtered.rescheduling.originalState.relearning.learning.scheduledSecs > states.good.filtered.rescheduling.originalState.relearning.learning.scheduledSecs) {
  states.hard.filtered.rescheduling.originalState.relearning.learning.scheduledSecs = states.good.filtered.rescheduling.originalState.relearning.learning.scheduledSecs;
}

// FSRS4Anki v4.5.6 Scheduler Qt6
set_version();
// The latest version will be released on https://github.com/open-spaced-repetition/fsrs4anki/releases/latest

// Configuration Start
// FSRS supports displaying memory states of cards.
// Enable it for debugging if you encounter something wrong.
const display_memory_state = true;

const deckParams = [
  {
    // Default parameters of FSRS4Anki for global
    "deckName": "global config for FSRS4Anki",
    "w": [0.4, 0.6, 2.4, 5.8, 4.93, 0.94, 0.86, 0.01, 1.49, 0.14, 0.94, 2.18, 0.05, 0.34, 1.26, 0.29, 2.61],
    // The above parameters can be optimized via FSRS4Anki optimizer.
    // For details about the parameters, please see: https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-Algorithm
    // User's custom parameters for global
    "requestRetention": 0.9, // recommended setting: 0.75 ~ 0.95
    "maximumInterval": 36500,
    // FSRS only modifies the long-term scheduling. So (re)learning steps in deck options work as usual.
    // I recommend setting steps shorter than 1 day.
  },
  {
    "deckName": "Top::Language",
    "w": [0.6436, 2.9047, 3.8645, 22.5929, 5.1363, 1.6328, 1.5416, 0.0051, 1.4432, 0.1, 1.0946, 2.0075, 0.1539, 0.3865, 1.9886, 0.2838, 6.3841],
    "requestRetention": 0.9,
    "maximumInterval": 36500,
  },
  {
    "deckName": "Top::Trivia",
    "w": [0.7127, 2.1688, 4.8475, 27.7297, 3.2037, 2.0675, 2.0751, 0.0, 1.5099, 0.1522, 1.3569, 1.7759, 0.1379, 0.3721, 1.9932, 0.2681, 8.269],
    "requestRetention": 0.9,
    "maximumInterval": 36500,
  },
  {
    "deckName": "Top",
    "w": [0.5317, 1.4336, 3.0735, 29.2601, 3.7603, 2.1585, 2.2375, 0.0006, 1.3592, 0.1098, 1.4773, 1.5683, 0.1349, 0.367, 1.9989, 0.3155, 6.9208],
    "requestRetention": 0.9,
    "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 = ["MainDeck3", "MainDeck4::SubDeck"];

// "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;

// Configuration End

debugger;

// display if FSRS is enabled
if (display_memory_state) {
  const prev = document.getElementById('FSRS_status')
  if (prev) { prev.remove(); }
  var fsrs_status = document.createElement('span');
  fsrs_status.innerHTML = "<br>FSRS enabled";
  fsrs_status.id = "FSRS_status";
  fsrs_status.style.cssText = "font-size:12px;opacity:0.5;font-family:monospace;text-align:left;line-height:1em;";
  document.body.appendChild(fsrs_status);
  document.getElementById("qa").style.cssText += "min-height:50vh;";
}
let params = {};
// Skip the SM2 ones.
switch(String(get_experiment_category())) {
  case "SM2":
    if(display_memory_state) {
      fsrs_status.innerHTML = fsrs_status.innerHTML.replace("FSRS enabled", "FSRS disabled (SM2)");
    }
    return;
    break;
  case "FSRS Default Weights":
    params = deckParams[0]
    if(display_memory_state) {
      fsrs_status.innerHTML += "<br>Default Weights";
    }
    break;
  case "FSRS Trained Weights":
    // get the name of the card's deck
    if (deck_name = get_deckname()) {
      if (display_memory_state) {
        fsrs_status.innerHTML += "<br>Deck name: " + deck_name;
      }
      for (const i of skip_decks) {
        if (deck_name.startsWith(i)) {
          if(display_memory_state) {
            fsrs_status.innerHTML = fsrs_status.innerHTML.replace("FSRS enabled", "FSRS disabled");
          }
          return;
        }
      }
      // Arrange the deckParams of sub-decks in front of their parent decks.
      deckParams.sort(function(a, b) {
        return -a.deckName.localeCompare(b.deckName);
      });
      for (let i = 0; i < deckParams.length; i++) {
        if (deck_name.startsWith(deckParams[i]["deckName"])) {
          params = deckParams[i];
          break;
        }
      }
    } else {
      if (display_memory_state) {
        fsrs_status.innerHTML += "<br>Deck name not found";
      }
    }
    if (Object.keys(params).length === 0) {
      params = deckParams.find(deck => deck.deckName === "global config for FSRS4Anki");
    }
    break
  default:
    fsrs_status.innerHTML += "<br>DID NOT GET EXPERIMENT CATEGORY";
    return
}

var w = params["w"];
var requestRetention = params["requestRetention"];
var maximumInterval = params["maximumInterval"];
// auto-calculate intervalModifier
const intervalModifier = 9 * (1 / requestRetention - 1);
// global fuzz factor for all ratings.
const fuzz_factor = set_fuzz_factor();
const ratings = {
  "again": 1,
  "hard": 2,
  "good": 3,
  "easy": 4
};
// For new cards
if (is_new()) {
  init_states();
  const good_interval = next_interval(customData.good.s);
  const easy_interval = Math.max(next_interval(customData.easy.s), good_interval + 1);
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
  // For learning/relearning cards
} else if (is_learning()) {
  // Init states if the card didn't contain customData
  if (is_empty()) {
    init_states();
  }
  const good_interval = next_interval(customData.good.s);
  const easy_interval = Math.max(next_interval(customData.easy.s), good_interval + 1);
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
} else if (is_review()) {
  // Convert the interval and factor to stability and difficulty if the card didn't contain customData
  if (is_empty()) {
    convert_states();
  }
  const interval = states.current.normal?.review.elapsedDays ? states.current.normal.review.elapsedDays : states.current.filtered.rescheduling.originalState.review.elapsedDays;
  const last_d = customData.again.d;
  const last_s = customData.again.s;
  const retrievability = Math.pow(1 + interval / (9 * last_s), -1)
  if (display_memory_state) {
    fsrs_status.innerHTML += "<br>D: " + last_d + "<br>S: " + last_s + "<br>R: " + (retrievability * 100).toFixed(2) + "%";
  }
  customData.again.d = next_difficulty(last_d, "again");
  customData.again.s = next_forget_stability(customData.again.d, last_s, retrievability);
  customData.hard.d = next_difficulty(last_d, "hard");
  customData.hard.s = next_recall_stability(customData.hard.d, last_s, retrievability, "hard");
  customData.good.d = next_difficulty(last_d, "good");
  customData.good.s = next_recall_stability(customData.good.d, last_s, retrievability, "good");
  customData.easy.d = next_difficulty(last_d, "easy");
  customData.easy.s = next_recall_stability(customData.easy.d, last_s, retrievability, "easy");
  let hard_interval = next_interval(customData.hard.s);
  let good_interval = next_interval(customData.good.s);
  let easy_interval = next_interval(customData.easy.s);
  hard_interval = Math.min(hard_interval, good_interval)
  good_interval = Math.max(good_interval, hard_interval + 1);
  easy_interval = Math.max(easy_interval, good_interval + 1);
  if (states.hard.normal?.review) {
    states.hard.normal.review.scheduledDays = hard_interval;
  }
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
}
function constrain_difficulty(difficulty) {
  return Math.min(Math.max(+difficulty.toFixed(2), 1), 10);
}
function apply_fuzz(ivl) {
  if (!enable_fuzz || ivl < 2.5) return ivl;
  ivl = Math.round(ivl);
  let min_ivl = Math.max(2, Math.round(ivl * 0.95 - 1));
  let max_ivl = Math.round(ivl * 1.05 + 1);
  if (is_review()) {
    const scheduledDays = states.current.normal?.review.scheduledDays ? states.current.normal.review.scheduledDays : states.current.filtered.rescheduling.originalState.review.scheduledDays;
    if (ivl > scheduledDays) {
      min_ivl = Math.max(min_ivl, scheduledDays + 1);
    }
  }
  return Math.floor(fuzz_factor * (max_ivl - min_ivl + 1) + min_ivl);
}
function next_interval(stability) {
  const new_interval = apply_fuzz(stability * intervalModifier);
  return Math.min(Math.max(Math.round(new_interval), 1), maximumInterval);
}
function next_difficulty(d, rating) {
  let next_d = d - w[6] * (ratings[rating] - 3);
  return constrain_difficulty(mean_reversion(w[4], next_d));
}
function mean_reversion(init, current) {
  return w[7] * init + (1 - w[7]) * current;
}
function next_recall_stability(d, s, r, rating) {
  let hardPenalty = rating === "hard" ? w[15] : 1;
  let easyBonus = rating === "easy" ? w[16] : 1;
  return +(s * (1 + Math.exp(w[8]) *
    (11 - d) *
    Math.pow(s, -w[9]) *
    (Math.exp((1 - r) * w[10]) - 1) *
    hardPenalty *
    easyBonus)).toFixed(2);
}
function next_forget_stability(d, s, r) {
  return +Math.min(w[11] * 
    Math.pow(d, -w[12]) * 
    (Math.pow(s + 1, w[13]) - 1) * 
    Math.exp((1 - r) * w[14]), s).toFixed(2);
}
function init_states() {
  customData.again.d = init_difficulty("again");
  customData.again.s = init_stability("again");
  customData.hard.d = init_difficulty("hard");
  customData.hard.s = init_stability("hard");
  customData.good.d = init_difficulty("good");
  customData.good.s = init_stability("good");
  customData.easy.d = init_difficulty("easy");
  customData.easy.s = init_stability("easy");
}
function init_difficulty(rating) {
  return +constrain_difficulty(w[4] - w[5] * (ratings[rating] - 3)).toFixed(2);
}
function init_stability(rating) {
  return +Math.max(w[ratings[rating] - 1], 0.1).toFixed(2);
}
function convert_states() {
  const scheduledDays = states.current.normal ? states.current.normal.review.scheduledDays : states.current.filtered.rescheduling.originalState.review.scheduledDays;
  const easeFactor = states.current.normal ? states.current.normal.review.easeFactor : states.current.filtered.rescheduling.originalState.review.easeFactor;
  const old_s = +Math.max(scheduledDays, 0.1).toFixed(2);
  const old_d = constrain_difficulty(11 - (easeFactor - 1) / (Math.exp(w[8]) * Math.pow(old_s, -w[9]) * (Math.exp(0.1 * w[10]) - 1)));
  customData.again.d = old_d;
  customData.again.s = old_s;
  customData.hard.d = old_d;
  customData.hard.s = old_s;
  customData.good.d = old_d;
  customData.good.s = old_s;
  customData.easy.d = old_d;
  customData.easy.s = old_s;
}
function is_new() {
  if (states.current.normal?.new !== undefined) {
    if (states.current.normal?.new !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'new')) {
      return true;
    }
  }
  return false;
}
function is_learning() {
  if (states.current.normal?.learning !== undefined) {
    if (states.current.normal?.learning !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'learning')) {
      return true;
    }
  }
  if (states.current.normal?.relearning !== undefined) {
    if (states.current.normal?.relearning !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'relearning')) {
      return true;
    }
  }
  return false;
}
function is_review() {
  if (states.current.normal?.review !== undefined) {
    if (states.current.normal?.review !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'review')) {
      return true;
    }
  }
  return false;
}
function is_empty() {
  return !customData.again.d | !customData.again.s | !customData.hard.d | !customData.hard.s | !customData.good.d | !customData.good.s | !customData.easy.d | !customData.easy.s;
}
function set_version() {
  const version = "v4.5.6";
  customData.again.v = version;
  customData.hard.v = version;
  customData.good.v = version;
  customData.easy.v = version;
}
function get_deckname() {
  if (typeof ctx !== 'undefined' && ctx.deckName) {
    return ctx.deckName;
  } else if (document.getElementById("deck") !== null && document.getElementById("deck").getAttribute("deck_name")) {
    return document.getElementById("deck").getAttribute("deck_name");
  } else {
    return null;
  }
}
function get_seed() {
  if (!customData.again.seed | !customData.hard.seed | !customData.good.seed | !customData.easy.seed) {
    if (typeof ctx !== 'undefined' && ctx.seed) {
      return ctx.seed;
    } else {
      return document.getElementById("qa").innerText;
    }
  } else {
    return customData.good.seed;
  }
}
function set_fuzz_factor() {
  // Note: Originally copied from seedrandom.js package (https://github.com/davidbau/seedrandom)
  !function(f,a,c){var s,l=256,p="random",d=c.pow(l,6),g=c.pow(2,52),y=2*g,h=l-1;function n(n,t,r){function e(){for(var n=u.g(6),t=d,r=0;n<g;)n=(n+r)*l,t*=l,r=u.g(1);for(;y<=n;)n/=2,t/=2,r>>>=1;return(n+r)/t}var o=[],i=j(function n(t,r){var e,o=[],i=typeof t;if(r&&"object"==i)for(e in t)try{o.push(n(t[e],r-1))}catch(n){}return o.length?o:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[n,S(a)]:null==n?function(){try{var n;return s&&(n=s.randomBytes)?n=n(l):(n=new Uint8Array(l),(f.crypto||f.msCrypto).getRandomValues(n)),S(n)}catch(n){var t=f.navigator,r=t&&t.plugins;return[+new Date,f,r,f.screen,S(a)]}}():n,3),o),u=new m(o);return e.int32=function(){return 0|u.g(4)},e.quick=function(){return u.g(4)/4294967296},e.double=e,j(S(u.S),a),(t.pass||r||function(n,t,r,e){return e&&(e.S&&v(e,u),n.state=function(){return v(u,{})}),r?(c[p]=n,t):n})(e,i,"global"in t?t.global:this==c,t.state)}function m(n){var t,r=n.length,u=this,e=0,o=u.i=u.j=0,i=u.S=[];for(r||(n=[r++]);e<l;)i[e]=e++;for(e=0;e<l;e++)i[e]=i[o=h&o+n[e%r]+(t=i[e])],i[o]=t;(u.g=function(n){for(var t,r=0,e=u.i,o=u.j,i=u.S;n--;)t=i[e=h&e+1],r=r*l+i[h&(i[e]=i[o=h&o+t])+(i[o]=t)];return u.i=e,u.j=o,r})(l)}function v(n,t){return t.i=n.i,t.j=n.j,t.S=n.S.slice(),t}function j(n,t){for(var r,e=n+"",o=0;o<e.length;)t[h&o]=h&(r^=19*t[h&o])+e.charCodeAt(o++);return S(t)}function S(n){return String.fromCharCode.apply(0,n)}if(j(c.random(),a),"object"==typeof module&&module.exports){module.exports=n;try{s=require("crypto")}catch(n){}}else"function"==typeof define&&define.amd?define(function(){return n}):c["seed"+p]=n}("undefined"!=typeof self?self:this,[],Math);
  // MIT License
  // Copyright 2019 David Bau.
  // Permission is hereby granted, free of charge, to any person obtaining a copy
  // of this software and associated documentation files (the "Software"), to deal
  // in the Software without restriction, including without limitation the rights
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  // copies of the Software, and to permit persons to whom the Software is
  // furnished to do so, subject to the following conditions:
  // The above copyright notice and this permission notice shall be included in all
  // copies or substantial portions of the Software.
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  // SOFTWARE.
  let seed = get_seed();
  const generator = new Math.seedrandom(seed);
  const fuzz_factor = generator();
  seed = Math.round(fuzz_factor * 10000);
  customData.again.seed = (seed + 1) % 10000;
  customData.hard.seed = (seed + 2) % 10000;
  customData.good.seed = (seed + 3) % 10000;
  customData.easy.seed = (seed + 4) % 10000;
  return fuzz_factor;
}
// Added for experiment purposes
function get_experiment_category() {
  if(!customData.experiment_category) {
    let card_id = Math.floor(Number(ctx.seed)/256); // it's <<8, roughly
    customData.experiment_card_id = card_id;
    switch(card_id%3) {
      case 0:
        customData.experiment_category = "FSRS Default Weights";
        break;
      case 1:
        customData.experiment_category = "SM2";
        break;
      case 2:
        customData.experiment_category = "FSRS Trained Weights";
        break;
      default:
        if(display_memory_state) {
          fsrs_status.innerHTML += "Error setting initial category!";
        }
        customData.experiment_category = "SM2";
    }
  }
  return customData.experiment_category;
}
if(display_memory_state) {
  fsrs_status.innerHTML += "Done!";
}

I hope to be able to report back with results in a year!

1 Like

Updated custom scheduling code today, after a couple days and a little tweaking and figuring out that I did not understand how customData worked.

I can also search by prop:cdn:expcat=1 (or 0 or 2) now, so no need for that python script.

I will say that whatever weights I got by training it on my collection are potentially way too aggressive when it comes to “easy”: there are several cards that had intervals of 1-5 years that were then given intervals of 15-30 years, which felt way too aggressive to me.

I’m curious how to remove things from customData later, when this experiment/demonstration is over, but I think I made it work now.

// Personal code: 
// makes the hard learning step equal to the good learning step if it's more.
if(states.hard.normal && states.hard.normal.learning && states.good.normal && states.good.normal.learning && states.hard.normal.learning.scheduledSecs > states.good.normal.learning.scheduledSecs) {
  states.hard.normal.learning.scheduledSecs = states.good.normal.learning.scheduledSecs;
}
if(states.hard.normal && states.hard.normal.relearning && states.hard.normal.relearning.learning && states.good.normal && states.good.normal.relearning && states.good.normal.relearning.learning && states.hard.normal.relearning.learning.scheduledSecs > states.good.normal.relearning.learning.scheduledSecs) {
  states.hard.normal.relearning.learning.scheduledSecs = states.good.normal.relearning.learning.scheduledSecs;
}
if(states.hard.filtered && states.hard.filtered.rescheduling && states.hard.filtered.rescheduling.originalState && states.hard.filtered.rescheduling.originalState.learning &&  states.good.filtered && states.good.filtered.rescheduling && states.good.filtered.rescheduling.originalState && states.good.filtered.rescheduling.originalState.learning && states.hard.filtered.rescheduling.originalState.learning.scheduledSecs > states.good.filtered.rescheduling.originalState.learning.scheduledSecs) {
  states.hard.filtered.rescheduling.originalState.learning.scheduledSecs = states.good.filtered.rescheduling.originalState.learning.scheduledSecs;
}
if(states.hard.filtered && states.hard.filtered.rescheduling && states.hard.filtered.rescheduling.originalState && states.hard.filtered.rescheduling.originalState.relearning && states.hard.filtered.rescheduling.originalState.relearning.learning &&  states.good.filtered && states.good.filtered.rescheduling && states.good.filtered.rescheduling.originalState && states.good.filtered.rescheduling.originalState.relearning && states.good.filtered.rescheduling.originalState.relearning.learning && states.hard.filtered.rescheduling.originalState.relearning.learning.scheduledSecs > states.good.filtered.rescheduling.originalState.relearning.learning.scheduledSecs) {
  states.hard.filtered.rescheduling.originalState.relearning.learning.scheduledSecs = states.good.filtered.rescheduling.originalState.relearning.learning.scheduledSecs;
}

// FSRS4Anki v4.5.6 Scheduler Qt6
set_version();
// The latest version will be released on https://github.com/open-spaced-repetition/fsrs4anki/releases/latest

// Configuration Start
// FSRS supports displaying memory states of cards.
// Enable it for debugging if you encounter something wrong.
const display_memory_state = true;

const deckParams = [
  {
    // Default parameters of FSRS4Anki for global
    "deckName": "global config for FSRS4Anki",
    "w": [0.4, 0.6, 2.4, 5.8, 4.93, 0.94, 0.86, 0.01, 1.49, 0.14, 0.94, 2.18, 0.05, 0.34, 1.26, 0.29, 2.61],
    // The above parameters can be optimized via FSRS4Anki optimizer.
    // For details about the parameters, please see: https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-Algorithm
    // User's custom parameters for global
    "requestRetention": 0.9, // recommended setting: 0.75 ~ 0.95
    "maximumInterval": 36500,
    // FSRS only modifies the long-term scheduling. So (re)learning steps in deck options work as usual.
    // I recommend setting steps shorter than 1 day.
  },
  {
    "deckName": "Top::Language",
    "w": [0.6436, 2.9047, 3.8645, 22.5929, 5.1363, 1.6328, 1.5416, 0.0051, 1.4432, 0.1, 1.0946, 2.0075, 0.1539, 0.3865, 1.9886, 0.2838, 6.3841],
    "requestRetention": 0.9,
    "maximumInterval": 36500,
  },
  {
    "deckName": "Top::Trivia",
    "w": [0.7127, 2.1688, 4.8475, 27.7297, 3.2037, 2.0675, 2.0751, 0.0, 1.5099, 0.1522, 1.3569, 1.7759, 0.1379, 0.3721, 1.9932, 0.2681, 8.269],
    "requestRetention": 0.9,
    "maximumInterval": 36500,
  },
  {
    "deckName": "Top",
    "w": [0.5317, 1.4336, 3.0735, 29.2601, 3.7603, 2.1585, 2.2375, 0.0006, 1.3592, 0.1098, 1.4773, 1.5683, 0.1349, 0.367, 1.9989, 0.3155, 6.9208],
    "requestRetention": 0.9,
    "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 = ["MainDeck3", "MainDeck4::SubDeck"];

// "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;

// Configuration End

debugger;

// display if FSRS is enabled
if (display_memory_state) {
  const prev = document.getElementById('FSRS_status')
  if (prev) { prev.remove(); }
  var fsrs_status = document.createElement('span');
  fsrs_status.innerHTML = "<br>FSRS enabled";
  fsrs_status.id = "FSRS_status";
  fsrs_status.style.cssText = "font-size:12px;opacity:0.5;font-family:monospace;text-align:left;line-height:1em;color:LightGray";
  document.body.appendChild(fsrs_status);
  document.getElementById("qa").style.cssText += "min-height:50vh;";
}
let params = {};
// Skip the SM2 ones.
switch(get_experiment_category()) {
  case 1: // SM2
    if(display_memory_state) {
      fsrs_status.innerHTML = fsrs_status.innerHTML.replace("FSRS enabled", "FSRS disabled (SM2)");
    }
    return;
    break;
  case 0: // FSRS default weights
    params = deckParams[0]
    if(display_memory_state) {
      fsrs_status.innerHTML += "<br>Default Weights";
    }
    break;
  case 2: // FSRS Trained Weights
    // get the name of the card's deck
    if (deck_name = get_deckname()) {
      for (const i of skip_decks) {
        if (deck_name.startsWith(i)) {
          if(display_memory_state) {
            fsrs_status.innerHTML = fsrs_status.innerHTML.replace("FSRS enabled", "FSRS disabled");
          }
          return;
        }
      }
      // Arrange the deckParams of sub-decks in front of their parent decks.
      deckParams.sort(function(a, b) {
        return -a.deckName.localeCompare(b.deckName);
      });
      for (let i = 0; i < deckParams.length; i++) {
        if (deck_name.startsWith(deckParams[i]["deckName"])) {
          params = deckParams[i];
      if (display_memory_state) {
        fsrs_status.innerHTML += "<br>Deck options: " + deckParams[i].deckName;
      }
          break;
        }
      }
    } else {
      if (display_memory_state) {
        fsrs_status.innerHTML += "<br>Deck name not found";
      }
    }
    if (Object.keys(params).length === 0) {
      params = deckParams.find(deck => deck.deckName === "global config for FSRS4Anki");
    }
    break
  default:
    fsrs_status.innerHTML += "<br>DID NOT GET EXPERIMENT CATEGORY";
    return
}

var w = params["w"];
var requestRetention = params["requestRetention"];
var maximumInterval = params["maximumInterval"];
// auto-calculate intervalModifier
const intervalModifier = 9 * (1 / requestRetention - 1);
// global fuzz factor for all ratings.
const fuzz_factor = set_fuzz_factor();
const ratings = {
  "again": 1,
  "hard": 2,
  "good": 3,
  "easy": 4
};
// For new cards
if (is_new()) {
  init_states();
  const good_interval = next_interval(customData.good.s);
  const easy_interval = Math.max(next_interval(customData.easy.s), good_interval + 1);
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
  // For learning/relearning cards
} else if (is_learning()) {
  // Init states if the card didn't contain customData
  if (is_empty()) {
    init_states();
  }
  const good_interval = next_interval(customData.good.s);
  const easy_interval = Math.max(next_interval(customData.easy.s), good_interval + 1);
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
} else if (is_review()) {
  // Convert the interval and factor to stability and difficulty if the card didn't contain customData
  if (is_empty()) {
    convert_states();
  }
  const interval = states.current.normal?.review.elapsedDays ? states.current.normal.review.elapsedDays : states.current.filtered.rescheduling.originalState.review.elapsedDays;
  const last_d = customData.again.d;
  const last_s = customData.again.s;
  const retrievability = Math.pow(1 + interval / (9 * last_s), -1)
  if (display_memory_state) {
    fsrs_status.innerHTML += "<br>D: " + last_d + "<br>S: " + last_s + "<br>R: " + (retrievability * 100).toFixed(2) + "%";
  }
  customData.again.d = next_difficulty(last_d, "again");
  customData.again.s = next_forget_stability(customData.again.d, last_s, retrievability);
  customData.hard.d = next_difficulty(last_d, "hard");
  customData.hard.s = next_recall_stability(customData.hard.d, last_s, retrievability, "hard");
  customData.good.d = next_difficulty(last_d, "good");
  customData.good.s = next_recall_stability(customData.good.d, last_s, retrievability, "good");
  customData.easy.d = next_difficulty(last_d, "easy");
  customData.easy.s = next_recall_stability(customData.easy.d, last_s, retrievability, "easy");
  let hard_interval = next_interval(customData.hard.s);
  let good_interval = next_interval(customData.good.s);
  let easy_interval = next_interval(customData.easy.s);
  hard_interval = Math.min(hard_interval, good_interval)
  good_interval = Math.max(good_interval, hard_interval + 1);
  easy_interval = Math.max(easy_interval, good_interval + 1);
  if (states.hard.normal?.review) {
    states.hard.normal.review.scheduledDays = hard_interval;
  }
  if (states.good.normal?.review) {
    states.good.normal.review.scheduledDays = good_interval;
  }
  if (states.easy.normal?.review) {
    states.easy.normal.review.scheduledDays = easy_interval;
  }
}
function constrain_difficulty(difficulty) {
  return Math.min(Math.max(+difficulty.toFixed(2), 1), 10);
}
function apply_fuzz(ivl) {
  if (!enable_fuzz || ivl < 2.5) return ivl;
  ivl = Math.round(ivl);
  let min_ivl = Math.max(2, Math.round(ivl * 0.95 - 1));
  let max_ivl = Math.round(ivl * 1.05 + 1);
  if (is_review()) {
    const scheduledDays = states.current.normal?.review.scheduledDays ? states.current.normal.review.scheduledDays : states.current.filtered.rescheduling.originalState.review.scheduledDays;
    if (ivl > scheduledDays) {
      min_ivl = Math.max(min_ivl, scheduledDays + 1);
    }
  }
  return Math.floor(fuzz_factor * (max_ivl - min_ivl + 1) + min_ivl);
}
function next_interval(stability) {
  const new_interval = apply_fuzz(stability * intervalModifier);
  return Math.min(Math.max(Math.round(new_interval), 1), maximumInterval);
}
function next_difficulty(d, rating) {
  let next_d = d - w[6] * (ratings[rating] - 3);
  return constrain_difficulty(mean_reversion(w[4], next_d));
}
function mean_reversion(init, current) {
  return w[7] * init + (1 - w[7]) * current;
}
function next_recall_stability(d, s, r, rating) {
  let hardPenalty = rating === "hard" ? w[15] : 1;
  let easyBonus = rating === "easy" ? w[16] : 1;
  return +(s * (1 + Math.exp(w[8]) *
    (11 - d) *
    Math.pow(s, -w[9]) *
    (Math.exp((1 - r) * w[10]) - 1) *
    hardPenalty *
    easyBonus)).toFixed(2);
}
function next_forget_stability(d, s, r) {
  return +Math.min(w[11] * 
    Math.pow(d, -w[12]) * 
    (Math.pow(s + 1, w[13]) - 1) * 
    Math.exp((1 - r) * w[14]), s).toFixed(2);
}
function init_states() {
  customData.again.d = init_difficulty("again");
  customData.again.s = init_stability("again");
  customData.hard.d = init_difficulty("hard");
  customData.hard.s = init_stability("hard");
  customData.good.d = init_difficulty("good");
  customData.good.s = init_stability("good");
  customData.easy.d = init_difficulty("easy");
  customData.easy.s = init_stability("easy");
}
function init_difficulty(rating) {
  return +constrain_difficulty(w[4] - w[5] * (ratings[rating] - 3)).toFixed(2);
}
function init_stability(rating) {
  return +Math.max(w[ratings[rating] - 1], 0.1).toFixed(2);
}
function convert_states() {
  const scheduledDays = states.current.normal ? states.current.normal.review.scheduledDays : states.current.filtered.rescheduling.originalState.review.scheduledDays;
  const easeFactor = states.current.normal ? states.current.normal.review.easeFactor : states.current.filtered.rescheduling.originalState.review.easeFactor;
  const old_s = +Math.max(scheduledDays, 0.1).toFixed(2);
  const old_d = constrain_difficulty(11 - (easeFactor - 1) / (Math.exp(w[8]) * Math.pow(old_s, -w[9]) * (Math.exp(0.1 * w[10]) - 1)));
  customData.again.d = old_d;
  customData.again.s = old_s;
  customData.hard.d = old_d;
  customData.hard.s = old_s;
  customData.good.d = old_d;
  customData.good.s = old_s;
  customData.easy.d = old_d;
  customData.easy.s = old_s;
}
function is_new() {
  if (states.current.normal?.new !== undefined) {
    if (states.current.normal?.new !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'new')) {
      return true;
    }
  }
  return false;
}
function is_learning() {
  if (states.current.normal?.learning !== undefined) {
    if (states.current.normal?.learning !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'learning')) {
      return true;
    }
  }
  if (states.current.normal?.relearning !== undefined) {
    if (states.current.normal?.relearning !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'relearning')) {
      return true;
    }
  }
  return false;
}
function is_review() {
  if (states.current.normal?.review !== undefined) {
    if (states.current.normal?.review !== null) {
      return true;
    }
  }
  if (states.current.filtered?.rescheduling?.originalState !== undefined) {
    if (Object.hasOwn(states.current.filtered?.rescheduling?.originalState, 'review')) {
      return true;
    }
  }
  return false;
}
function is_empty() {
  return !customData.again.d | !customData.again.s | !customData.hard.d | !customData.hard.s | !customData.good.d | !customData.good.s | !customData.easy.d | !customData.easy.s;
}
function set_version() {
  const version = "v4.5.6";
  customData.again.v = version;
  customData.hard.v = version;
  customData.good.v = version;
  customData.easy.v = version;
}
function get_deckname() {
  if (typeof ctx !== 'undefined' && ctx.deckName) {
    return ctx.deckName;
  } else if (document.getElementById("deck") !== null && document.getElementById("deck").getAttribute("deck_name")) {
    return document.getElementById("deck").getAttribute("deck_name");
  } else {
    return null;
  }
}
function get_seed() {
  if (!customData.again.seed | !customData.hard.seed | !customData.good.seed | !customData.easy.seed) {
    if (typeof ctx !== 'undefined' && ctx.seed) {
      return ctx.seed;
    } else {
      return document.getElementById("qa").innerText;
    }
  } else {
    return customData.good.seed;
  }
}
function set_fuzz_factor() {
  // Note: Originally copied from seedrandom.js package (https://github.com/davidbau/seedrandom)
  !function(f,a,c){var s,l=256,p="random",d=c.pow(l,6),g=c.pow(2,52),y=2*g,h=l-1;function n(n,t,r){function e(){for(var n=u.g(6),t=d,r=0;n<g;)n=(n+r)*l,t*=l,r=u.g(1);for(;y<=n;)n/=2,t/=2,r>>>=1;return(n+r)/t}var o=[],i=j(function n(t,r){var e,o=[],i=typeof t;if(r&&"object"==i)for(e in t)try{o.push(n(t[e],r-1))}catch(n){}return o.length?o:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[n,S(a)]:null==n?function(){try{var n;return s&&(n=s.randomBytes)?n=n(l):(n=new Uint8Array(l),(f.crypto||f.msCrypto).getRandomValues(n)),S(n)}catch(n){var t=f.navigator,r=t&&t.plugins;return[+new Date,f,r,f.screen,S(a)]}}():n,3),o),u=new m(o);return e.int32=function(){return 0|u.g(4)},e.quick=function(){return u.g(4)/4294967296},e.double=e,j(S(u.S),a),(t.pass||r||function(n,t,r,e){return e&&(e.S&&v(e,u),n.state=function(){return v(u,{})}),r?(c[p]=n,t):n})(e,i,"global"in t?t.global:this==c,t.state)}function m(n){var t,r=n.length,u=this,e=0,o=u.i=u.j=0,i=u.S=[];for(r||(n=[r++]);e<l;)i[e]=e++;for(e=0;e<l;e++)i[e]=i[o=h&o+n[e%r]+(t=i[e])],i[o]=t;(u.g=function(n){for(var t,r=0,e=u.i,o=u.j,i=u.S;n--;)t=i[e=h&e+1],r=r*l+i[h&(i[e]=i[o=h&o+t])+(i[o]=t)];return u.i=e,u.j=o,r})(l)}function v(n,t){return t.i=n.i,t.j=n.j,t.S=n.S.slice(),t}function j(n,t){for(var r,e=n+"",o=0;o<e.length;)t[h&o]=h&(r^=19*t[h&o])+e.charCodeAt(o++);return S(t)}function S(n){return String.fromCharCode.apply(0,n)}if(j(c.random(),a),"object"==typeof module&&module.exports){module.exports=n;try{s=require("crypto")}catch(n){}}else"function"==typeof define&&define.amd?define(function(){return n}):c["seed"+p]=n}("undefined"!=typeof self?self:this,[],Math);
  // MIT License
  // Copyright 2019 David Bau.
  // Permission is hereby granted, free of charge, to any person obtaining a copy
  // of this software and associated documentation files (the "Software"), to deal
  // in the Software without restriction, including without limitation the rights
  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  // copies of the Software, and to permit persons to whom the Software is
  // furnished to do so, subject to the following conditions:
  // The above copyright notice and this permission notice shall be included in all
  // copies or substantial portions of the Software.
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  // SOFTWARE.
  let seed = get_seed();
  const generator = new Math.seedrandom(seed);
  const fuzz_factor = generator();
  seed = Math.round(fuzz_factor * 10000);
  customData.again.seed = (seed + 1) % 10000;
  customData.hard.seed = (seed + 2) % 10000;
  customData.good.seed = (seed + 3) % 10000;
  customData.easy.seed = (seed + 4) % 10000;
  return fuzz_factor;
}
// Added for experiment purposes
function get_experiment_category() {
  if(customData.again.expcat===undefined || customData.hard.expcat===undefined || customData.good.expcat===undefined || customData.easy.expcat===undefined) {
    fsrs_status.innerHTML += "<br>Init~";
    let card_id = Math.floor(Number(ctx.seed)/256); // it's <<8, roughly
    customData.again.expcid = card_id;
    customData.hard.expcid = card_id;
    customData.good.expcid = card_id;
    customData.easy.expcid = card_id;
    customData.again.expcat = card_id%3;
    customData.hard.expcat = card_id%3;
    customData.good.expcat = card_id%3;
    customData.easy.expcat = card_id%3;
  }
  
  return customData.good.expcat;
}
if(display_memory_state) {
  fsrs_status.innerHTML += "<br>Done!";
}

prop:cdn:expcat=0 introduced:30 (FSRS with default weights)


prop:cdn:expcat=1 introduced:30 (SM2)

prop:cdn:expcat=2 introduced:30 (FSRS with optimized weights)

It’s actually pretty hard to draw any sort of conclusions from these - there’s only been 80-88 cards introduced in each category… and most of these have only had one or two non-learning reviews…

prop:cdn:expcat=0 (FSRS with default weights, 1816 cards)

prop:cdn:expcat=1 (SM2, 1725 cards)

prop:cdn:expcat=2 (FSRS with optimized weights, 1711 cards)

Again, hard to draw any conclusions. A lot of these have only been reviewed once within this time frame, and were using SM2 before about a month ago. I’ll report back at 3 months and 1 year, and maybe it’ll be interesting.

I also have the collection available, with all the card data removed but it should have the history available, if anyone wants to take a look.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.