Skip to content

Commit

Permalink
fix format & revert parameteredIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed May 22, 2024
1 parent 92681df commit 720b461
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ mod error;
mod inference;
mod model;
mod optimal_retention;
mod parameter_clipper;
mod pre_training;
#[cfg(test)]
mod test_helpers;
mod training;
mod parameter_clipper;

pub use dataset::{FSRSItem, FSRSReview};
pub use error::{FSRSError, Result};
Expand Down
6 changes: 3 additions & 3 deletions src/optimal_retention.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ndarray::{s, Array1, Array2, Ix0, Ix1, SliceInfoElem, Zip};
use ndarray_rand::rand_distr::Distribution;
use ndarray_rand::RandomExt;
use rand::{
distributions::{Uniform, parameteredIndex},
distributions::{Uniform, WeightedIndex},
rngs::StdRng,
SeedableRng,
};
Expand Down Expand Up @@ -148,10 +148,10 @@ pub fn simulate(
let mut cost_per_day = Array1::zeros(learn_span);

let first_rating_choices = [1, 2, 3, 4];
let first_rating_dist = parameteredIndex::new(first_rating_prob).unwrap();
let first_rating_dist = WeightedIndex::new(first_rating_prob).unwrap();

let review_rating_choices = [2, 3, 4];
let review_rating_dist = parameteredIndex::new(review_rating_prob).unwrap();
let review_rating_dist = WeightedIndex::new(review_rating_prob).unwrap();

let mut rng = StdRng::seed_from_u64(seed.unwrap_or(42));

Expand Down
2 changes: 1 addition & 1 deletion src/training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::cosine_annealing::CosineAnnealingLR;
use crate::dataset::{split_filter_data, FSRSBatcher, FSRSDataset, FSRSItem};
use crate::error::Result;
use crate::model::{Model, ModelConfig};
use crate::pre_training::pretrain;
use crate::parameter_clipper::parameter_clipper;
use crate::pre_training::pretrain;
use crate::{FSRSError, DEFAULT_PARAMETERS, FSRS};
use burn::backend::Autodiff;

Expand Down

0 comments on commit 720b461

Please sign in to comment.