Skip to content

Commit

Permalink
Fix h-function rust tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinHirschi committed Jul 24, 2024
1 parent 0101d49 commit 3beff33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/test_resources/default_tests_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ Integrator:
n_increase: 10000
n_max: 10000000000
integrated_phase: real
learning_rate: 1.5
discrete_dim_learning_rate: 1.5
continuous_dim_learning_rate: 1.5
train_on_avg: false
show_max_wgt_info: true
max_prob_ratio: 0.01
Expand All @@ -57,4 +58,4 @@ subtraction:
function: poly_exponential
sigma: 1.0
enabled_dampening: true
power: null
power: null
10 changes: 5 additions & 5 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,18 +1636,18 @@ pub fn h<T: FloatLike>(
),
};

println!("normalisation: {}", normalisation);
println!("t: {}", t);
println!("sig: {}", sig);
println!("power: {:?}", power);
// println!("normalisation: {}", normalisation);
// println!("t: {}", t);
// println!("sig: {}", sig);
// println!("power: {:?}", power);


let prefactor = match power {
None | Some(0) => normalisation.inv(),
Some(p) => (&t / &sig).powi(-(p as i32)) / normalisation,
};

println!("prefactor: {}", prefactor);
// println!("prefactor: {}", prefactor);
prefactor
* (F::<T>::from_f64(2_f64) - ((t.square()) / (sig.square()) + t.one()) / (t / sig)).exp()
}
Expand Down

0 comments on commit 3beff33

Please sign in to comment.