Skip to content

Commit

Permalink
Merge branch 'main' into serialize_optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
coreylowman committed Jul 10, 2023
2 parents 1d31c57 + 442b4a6 commit cbcc691
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/nn/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ where
|s| &s.weight,
|s| &mut s.weight,
TensorOptions::reset_with(|t| {
let b = E::ONE / E::from_usize(I * K * K).unwrap().sqrt();
let scale = E::from_f64(G as f64 / (I * K * K) as f64).unwrap();
let b = scale.sqrt();
t.try_fill_with_distr(rand_distr::Uniform::new(-b, b))
}),
),
Expand Down
3 changes: 2 additions & 1 deletion src/nn/convtrans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ where
|s| &s.weight,
|s| &mut s.weight,
TensorOptions::reset_with(|t| {
let b = E::ONE / E::from_usize(I * K * K).unwrap().sqrt();
let scale = E::from_f64(G as f64 / (I * K * K) as f64).unwrap();
let b = scale.sqrt();
t.try_fill_with_distr(rand_distr::Uniform::new(-b, b))
}),
),
Expand Down

0 comments on commit cbcc691

Please sign in to comment.