-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix/set pretrain_only by fsrs_items #3051
Fix/set pretrain_only by fsrs_items #3051
Conversation
I'm concerned this change is undoing work done in #3027. We want to show 'reviews' rather than 'items' to the user, as FSRS items are not an intuitive thing for users. Also, could I trouble you to explain why this change works? The goal of the pretrain_only argument was so that the Anki crate could have control over the threshold. Why does the code work when using FSRS items and not when using revlogs? |
Because |
And |
review_count will be 0 when fsrs_items is 0 according to my understanding of fsrs_items_for_training(). |
They are different. #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct FSRSItem {
pub reviews: Vec<FSRSReview>,
}
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct FSRSReview {
/// 1-4
pub rating: u32,
/// The number of days that passed
pub delta_t: u32,
}
impl FSRSItem {
// The previous reviews done before the current one.
pub(crate) fn history(&self) -> impl Iterator<Item = &FSRSReview> {
self.reviews.iter().take(self.reviews.len() - 1)
}
pub(crate) fn current(&self) -> &FSRSReview {
self.reviews.last().unwrap()
}
} |
I'm not arguing they are equivalent, just that fsrs_items_for_training() returns review_count=0 when fsrs_items=0. That's because it's incrementing review_count inside .flat_map() after .filter_map(), and single_card_revlog_to_items() returns None when there are no items. |
OK. But it's possible that the |
I update the code. Now |
Should we use it for progress though? |
If we use review count for progress, it will never reach 100%. |
…ws-based-on-fsrs_items
Only |
…ws-based-on-fsrs_items
Thanks Jarrett! |
It fixed https://forums.ankiweb.net/t/anki-24-04-beta/41792/18.