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

Fine tuned w1 and w2 for pretraining #269

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pre_training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ pub(crate) fn smooth_and_fill(
}
}

let w1 = 3.0 / 5.0;
let w2 = 3.0 / 5.0;
let w1 = 0.41;
let w2 = 0.54;

let mut init_s0 = vec![];

Expand Down Expand Up @@ -357,15 +357,15 @@ mod tests {
let items = [pretrainset.clone(), trainset].concat();
let average_recall = calculate_average_recall(&items);
Data::from(pretrain(pretrainset, average_recall).unwrap().0)
.assert_approx_eq(&Data::from([0.908_688, 1.678_973, 4.216_837, 9.615_904]), 6)
.assert_approx_eq(&Data::from([0.908_688, 2.247_462, 4.216_837, 9.615_904]), 6)
}

#[test]
fn test_smooth_and_fill() {
let mut rating_stability = HashMap::from([(1, 0.4), (3, 2.3), (4, 10.9)]);
let rating_count = HashMap::from([(1, 1), (2, 1), (3, 1), (4, 1)]);
let actual = smooth_and_fill(&mut rating_stability, &rating_count).unwrap();
assert_eq!(actual, [0.4, 0.8052433, 2.3, 10.9,]);
assert_eq!(actual, [0.4, 1.1227008, 2.3, 10.9,]);

let mut rating_stability = HashMap::from([(2, 0.35)]);
let rating_count = HashMap::from([(2, 1)]);
Expand Down
Loading