-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Simplify Revlog->FSRSItem conversion #13
Conversation
31f796c
to
682c503
Compare
My earlier code was quite wrong, as I'd assumed there'd be only one FSRSItem for each card. The new code is passing the tests - does it look ok to you? One remaining question - if we look at the shape of FSRSItem and FSRSReview, the delta_t and rating are now the same: /// Represents a single review on a card, and contains the previous reviews for that card.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
pub struct FSRSItem {
/// The previous reviews done to the card before the current one
pub reviews: Vec<FSRSReview>,
/// 1-4
pub rating: i32,
/// The number of days that passed
pub delta_t: i32,
}
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
pub struct FSRSReview {
/// 1-4
pub rating: i32,
/// The number of days that passed
pub delta_t: i32,
} Would it make sense to remove the rating/delta_t from FSRSItem, and instead place one more review in the vec instead? Eg have it store current+previous reviews, and not just previous reviews. |
Yeah, it's OK. I have read the code and found that you convert rating to label in FSRSBatcher. After insert the last rating/delta_t into vec, we need pop it and convert it into label in FSRSBatcher. |
.retain() is fairly expensive, as it requires shuffling data about; better to filter the material before the array is created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I have reviewed the code and trained FSRS with the test collection.
Depends on #12.
I wasn't entirely sure what the current code was trying to do, so please double-check it still performs as you expect / let me know if it's changed the behavior.