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

Feat/long-term schduler #100

Merged
merged 13 commits into from
Jul 25, 2024
Merged

Feat/long-term schduler #100

merged 13 commits into from
Jul 25, 2024

Conversation

ishiko732
Copy link
Collaborator

@L-M-Sherlock
I am uncertain whether the state transition from New to Review is correct; I need you to verify the LongTermScheduler.newState and LongTermScheduler.reviewState methods.

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ba57899) to head (3294c28).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main      #100    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files            9        10     +1     
  Lines          439       557   +118     
  Branches        50        58     +8     
==========================================
+ Hits           439       557   +118     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ishiko732 ishiko732 linked an issue Jul 21, 2024 that may be closed by this pull request
@L-M-Sherlock
Copy link
Member

How can I check them quickly? Do you have any unit tests?

src/fsrs/default.ts Outdated Show resolved Hide resolved
@ishiko732
Copy link
Collaborator Author

ishiko732 commented Jul 21, 2024

Do you have any unit tests?

https://github.com/open-spaced-repetition/ts-fsrs/blob/11429fff6568dc49ed2d549f2b751bfdecc7c5c9/__tests__/impl/long-term_schduler.test.ts

  const parameters = {
    request_retention: 0.9,
    maximum_interval: 36500,
    w: [
      0.4197, 1.1869, 3.0412, 15.2441, 7.1434, 0.6477, 1.0007, 0.0674, 1.6597,
      0.1712, 1.1178, 2.0225, 0.0904, 0.3025, 2.1214, 0.2498, 2.9466, 0.4891,
      0.6468,
    ],
    enable_fuzz: false,
    enable_short_term: false,
  }

first_time: 2022/11/29 12:30:00

test1

Grades:

[Good, Good, Good, Good, Good, Good, Again, Again, Good, Good, Good, Good, Good]

ivl_history:

[3, 6, 17, 42, 95, 200, 8, 2, 3, 5, 8, 14, 23]

s_history:

[
      0.57587467, 6.28341418, 16.83356103, 41.95128557, 95.07063986,
      199.53765138, 8.31519008, 1.96276113, 3.06877302, 4.90880017, 8.15177579,
      13.50873393, 22.92901865,
    ]

d_history:

[
      7.1434, 7.1434, 7.1434, 7.1434, 7.1434, 7.1434, 9.00990564, 10,
      9.80746516, 9.62790717, 9.46045139, 9.30428213, 9.15863867,
    ]

test2

Grades:

[Again, Hard, Good, Easy, Again, Hard, Good, Easy]

ivl_history:

[1, 2, 3, 8, 2, 2, 4, 10]

s_history:

[
      0.21652154, 0.51780862, 1.8183783, 8.18593986, 1.96087115, 2.23717242,
      3.33185406, 10.31008873,
    ]

d_history:

[
      9.00990564, 9.81735598, 9.63713135, 8.53580104, 10, 10, 9.80746516,
      8.69465435,
    ]

test3

Grades:

[Hard, Good, Easy, Again, Hard, Good, Easy, Again]

ivl_history:

[2, 3, 17, 3, 4, 6, 18, 3]

s_history:

[
      0.35311368, 3.40179546, 16.86596974, 2.9223039, 3.73601023, 6.27595217,
      18.057595, 2.96541083,
    ]

d_history:

[
      8.07665282, 8.01375158, 7.02183706, 8.89653604, 9.71162749, 9.53852896,
      8.44384445, 10,
    ]

test4

Grades:

[Good, Easy, Again, Hard, Good, Easy, Again, Hard]

ivl_history:

[3, 17, 3, 4, 8, 30, 4, 4]

s_history:

[
      0.57587467, 17.3937106, 2.98322161, 4.08808234, 7.99405969, 29.76078201,
      3.78204811, 4.44627015,
    ]

d_history:

[
      7.1434, 6.21014718, 8.13955406, 9.0056661, 8.88014936, 7.82983963,
      9.65007924, 10,
    ]

test5

Grades:

[Easy, Again, Hard, Good, Easy, Again, Hard, Good]

ivl_history:

[4, 1, 2, 3, 13, 3, 3, 5]

s_history:

[
      0.93916394, 0.70772253, 1.16119435, 3.42301186, 12.97577367, 2.53486926,
      3.06202367, 4.60523893,
    ]
d_history:
[
      6.21014718, 8.13955406, 9.0056661, 8.88014936, 7.82983963, 9.65007924, 10,
      9.80746516,
    ]

@ishiko732
Copy link
Collaborator Author

How can I check them quickly?

I will write a preview page when I have time.

@L-M-Sherlock
Copy link
Member

test1

Grades:

[Good, Good, Good, Good, Good, Good, Again, Again, Good, Good, Good, Good, Good]

ivl_history:

[3, 6, 17, 42, 95, 200, 8, 2, 3, 3, 6, 10, 17]

s_history:

[
      0.57587467, 6.28341418, 16.83356103, 41.95128557, 95.07063986,
      199.53765138, 8.31519008, 1.59859456, 1.59859456, 3.49350932, 5.58821385,
      9.83641092, 16.95422162,
    ]
d_history:
[
      7.1434, 7.1434, 7.1434, 7.1434, 7.1434, 7.1434, 9.00990564, 10,
      9.80746516, 9.62790717, 9.46045139, 9.30428213, 9.15863867,
    ]

Why the first Good after the last Again doesn't change the stability?

@ishiko732

This comment was marked as outdated.

@ishiko732
Copy link
Collaborator Author

Why the first Good after the last Again doesn't change the stability?

next_again.scheduled_days = again_interval
next_again.due = this.review_time.scheduler(again_interval as int)

scheduled it by minutes here, which was a mistake. I’ll make the adjustments tonight. 😢

@ishiko732
Copy link
Collaborator Author

switch long-term schduler test

Grades:

[Good(short), Good(long), Again(long), Good(long), Good(short), Again(short)]

ivl_history:

[0, 4, 1, 4, 12, 0]

s_history:

[
      3.0412, 3.0412, 1.20788692, 3.83856852, 12.23542321, 2.48288917,
    ]

d_history:

[4.49094334, 4.66971892, 6.70295066, 6.73263695,6.76032238,8.65264745]

state_history:

['Learning', 'Review', 'Review', 'Review','Review','Relearning']

@L-M-Sherlock
Copy link
Member

Hi, @remnoteio, @sobjornstad, @bjsi. This PR will allow user to skip the short-term schedule. I guess you will be interested in it.

Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

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

LGTM

@ishiko732 ishiko732 marked this pull request as ready for review July 25, 2024 14:40
@ishiko732 ishiko732 requested a review from L-M-Sherlock July 25, 2024 14:53
Copy link
Member

@L-M-Sherlock L-M-Sherlock left a comment

Choose a reason for hiding this comment

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

LGTM

@ishiko732 ishiko732 merged commit 9285e33 into main Jul 25, 2024
5 checks passed
@ishiko732 ishiko732 deleted the Feat/long-term-schduler branch July 25, 2024 15:23
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.

[Feat] switch of enable/disable short-term schedule
2 participants