Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@L-M-Sherlock
Copy link
Contributor

@L-M-Sherlock L-M-Sherlock commented Apr 17, 2025

wait for open-spaced-repetition/fsrs-rs#313

I will release FSRS-rs v3.0.0 after the above PR is merged.

FSRS 6.0 Integration

Changes

  • Updated FSRS dependency to version 6.0
  • Added support for FSRS 6.0 parameters with 21 weights (including decay parameter)
  • Added decay field to card data structure
  • Updated forgetting curve calculation to use decay parameter
  • Modified deck configuration to support FSRS 6.0 parameters
  • Updated simulator and retention calculation logic for FSRS 6.0

Key Features

  1. Decay Parameter Support

    • Added decay field to card data structure
    • Default decay values:
      • FSRS 6.0: 0.2
      • FSRS 4.5/5.0: 0.5
    • Updated forgetting curve calculation to use decay parameter
  2. Parameter Management

    • Added fsrs_params_6 field to deck configuration
    • Maintained backward compatibility with FSRS 4.5 and 5.0 parameters
    • Updated parameter optimization and simulation logic
  3. UI Updates

    • Modified forgetting curve visualization to account for decay
    • Updated deck options interface to support FSRS 6.0 parameters

Technical Details

  • Updated protobuf definitions to include decay field
  • Modified memory state handling to include decay parameter
  • Updated SQLite storage to handle new decay field
  • Adjusted simulator configuration for FSRS 6.0 parameters

Dependencies

  • Updated FSRS dependency to latest version
  • Updated various Rust dependencies to compatible versions

Testing

  • Updated test cases to handle new decay parameter
  • Modified forgetting curve tests to account for decay
  • Updated simulator tests for FSRS 6.0 parameters

Notes

  • This update maintains backward compatibility with existing FSRS 4.5 and 5.0 configurations
  • Users can continue using their existing parameters until they choose to upgrade to FSRS 6.0
  • The decay parameter provides more flexibility in forgetting curve modeling

@Expertium
Copy link
Contributor

Expertium commented Apr 17, 2025

@Luc-Mcgrady once this is merged, hopefully you can work on reimplementing CMRR as I described
EDIT: maybe Jarrett was right. Seems like after the FSRS-6 update, CMRR is just stuck at 70% or close to 70% pretty much all the time. "Best I can do is 70%" (c) CMRR. Perhaps we should remove it after all, like Jarrett originally intended

let fsrs = FSRS::new(req.as_ref().map(|w| &w.params[..]).or(Some([].as_slice())))?;
let decay = req.as_ref().map(|w| {
if w.params.is_empty() {
0.2 // default decay for FSRS-6
Copy link
Contributor

@Expertium Expertium Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this value matter? I assume the actual value will always be fetched from the user's parameters. If it does matter somehow, shouldn't it be set precisely to the default value of decay, which is 0.1832?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.1832? The default value is 0.2. https://github.com/open-spaced-repetition/fsrs-optimizer/blob/ba7c044c907fecdabf5b3f106338e77e50a29a86/src/fsrs_optimizer/fsrs_optimizer.py#L67

And if the user doesn't optimize the parameters, the parameters will be empty.

Copy link
Contributor

@Expertium Expertium Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I was looking at this
20250418_120451

And if the user doesn't optimize the parameters, the parameters will be empty.

Wait, I thought in that case the default parameters are used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default parameters of FSRS-rs is consistent with Python Ver: https://github.com/open-spaced-repetition/fsrs-rs/blob/fcbd45a6d49b27a8d1764af528560bfe10c2ff9c/src/inference.rs#L26

Wait, I thought in that case the default parameters are used?

The default parameters are not stored in presets because it would change when fsrs-rs is updated.

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, but I noticed a couple of things:

@dae
Copy link
Member

dae commented Apr 25, 2025

Thanks all. Looks good to go 👍

@dae dae merged commit e096c46 into ankitects:main Apr 25, 2025
1 check passed
@L-M-Sherlock L-M-Sherlock deleted the Feat/FSRS-6 branch April 25, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants