open-spaced-repetition / ts-fsrs

ts-fsrs is a versatile package based on TypeScript that supports ES modules, CommonJS, and UMD.
https://open-spaced-repetition.github.io/ts-fsrs/
MIT License
216 stars 22 forks source link

FSRS-5 test #115

Closed joshdavham closed 3 months ago

joshdavham commented 3 months ago

I'm currently writing tests for the py-fsrs update for fsrs-5 and was wondering where you got these intervals from.

https://github.com/open-spaced-repetition/ts-fsrs/blob/65fd676414e23e21612b5344af947480f7dafa7e/__tests__/FSRSV5.test.ts#L59-L61

I was looking through the fsrs-optimizer repo and am guessing you got the weights for this test from there?

https://github.com/open-spaced-repetition/fsrs-optimizer/blob/ef723f82da08c3e8bf2890c557f5a4e4bd4dc936/src/fsrs_optimizer/fsrs_simulator.py#L574-L594

Did you use the fsrs-optimizer to compute those intervals? If that's where you computed the intervals, how should I replicate it? The documentation for the fsrs-optimizer is still quite sparse.

ishiko732 commented 3 months ago

I was looking through the fsrs-optimizer repo and am guessing you got the weights for this test from there?

The weights for TS-FSRS are derived from the DEFAULT_PARAMETERS in fsrs-rs, as shown here: https://github.com/open-spaced-repetition/fsrs-rs/blob/ea80c61ac0cfc6847a19d0ea3d63eaae4947e87c/src/inference.rs#L24-L27.

The weights in the FSRS v5 test set for TS-FSRS do not change with the default parameters. Additionally, every method implementation in TS-FSRS is consistent with FSRS-RS in unit tests, though there may be minor differences in decimal tail numbers. You can see the tests here:

Currently, TS-FSRS has two scheduling modes (short-term and long-term Scheduler), so the ivl_history used in testing is calculated from internal outputs.

joshdavham commented 3 months ago

Thanks for the response!

A couple things

The weights in the FSRS v5 test set for TS-FSRS do not change with the default parameters.

The weights for this FSRS-5 test: https://github.com/open-spaced-repetition/ts-fsrs/blob/65fd676414e23e21612b5344af947480f7dafa7e/__tests__/FSRSV5.test.ts#L12-L16

are different from the default ts-fsrs weights: https://github.com/open-spaced-repetition/ts-fsrs/blob/65fd676414e23e21612b5344af947480f7dafa7e/src/fsrs/default.ts#L6-L10

So I'm not really sure what you mean here?


the ivl_history used in testing is calculated from internal outputs.

Do you mean that the ivl_history in https://github.com/open-spaced-repetition/ts-fsrs/blob/65fd676414e23e21612b5344af947480f7dafa7e/__tests__/FSRSV5.test.ts#L59-L61 was originally calculated by ts-fsrs and not somewhere else? I was wondering if the intervals were originally taken from somewhere else as a 'ground truth' to test against. Is this not the case?

L-M-Sherlock commented 3 months ago

are different from the default ts-fsrs weights:

I'm sorry I updated the weights in the last patch and forgot to remind @ishiko732.

I was wondering if the intervals were originally taken from somewhere else as a 'ground truth' to test against.

ts-fsrs is ground truth unless we integrate the scheduler part into fsrs-rs, but it requires a huge work: https://github.com/open-spaced-repetition/fsrs-rs/issues/210

joshdavham commented 3 months ago

My questions have been answered! 谢谢 to you both