From a350ddc980204218c72879bf28d12b2dddecf825 Mon Sep 17 00:00:00 2001 From: meliurwen Date: Tue, 12 Apr 2022 13:40:00 +0200 Subject: [PATCH] Decreased epsilon to `0.1` with a new seed --- tests/parameter_learning.rs | 16 ++++++++-------- tests/params.rs | 6 +++--- tests/tools.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/parameter_learning.rs b/tests/parameter_learning.rs index adff6e8..15245fd 100644 --- a/tests/parameter_learning.rs +++ b/tests/parameter_learning.rs @@ -40,14 +40,14 @@ fn learn_binary_cim (pl: T) { } } - let data = trajectory_generator(&net, 100, 100.0, Some(1234),); + let data = trajectory_generator(&net, 100, 100.0, Some(6347747169756259),); let (CIM, M, T) = pl.fit(&net, &data, 1, None); print!("CIM: {:?}\nM: {:?}\nT: {:?}\n", CIM, M, T); assert_eq!(CIM.shape(), [2, 2, 2]); assert!(CIM.abs_diff_eq(&arr3(&[ [[-1.0, 1.0], [4.0, -4.0]], [[-6.0, 6.0], [2.0, -2.0]], - ]), 0.3)); + ]), 0.1)); } #[test] @@ -93,7 +93,7 @@ fn learn_ternary_cim (pl: T) { } } - let data = trajectory_generator(&net, 100, 200.0, Some(1234),); + let data = trajectory_generator(&net, 100, 200.0, Some(6347747169756259),); let (CIM, M, T) = pl.fit(&net, &data, 1, None); print!("CIM: {:?}\nM: {:?}\nT: {:?}\n", CIM, M, T); assert_eq!(CIM.shape(), [3, 3, 3]); @@ -101,7 +101,7 @@ fn learn_ternary_cim (pl: T) { [[-1.0, 0.5, 0.5], [3.0, -4.0, 1.0], [0.9, 0.1, -1.0]], [[-6.0, 2.0, 4.0], [1.5, -2.0, 0.5], [3.0, 1.0, -4.0]], [[-1.0, 0.1, 0.9], [2.0, -2.5, 0.5], [0.9, 0.1, -1.0]], - ]), 0.3)); + ]), 0.1)); } @@ -148,13 +148,13 @@ fn learn_ternary_cim_no_parents (pl: T) { } } - let data = trajectory_generator(&net, 100, 200.0, Some(1234),); + let data = trajectory_generator(&net, 100, 200.0, Some(6347747169756259),); let (CIM, M, T) = pl.fit(&net, &data, 0, None); print!("CIM: {:?}\nM: {:?}\nT: {:?}\n", CIM, M, T); assert_eq!(CIM.shape(), [1, 3, 3]); assert!(CIM.abs_diff_eq(&arr3(&[[[-3.0, 2.0, 1.0], [1.5, -2.0, 0.5], - [0.4, 0.6, -1.0]]]), 0.3)); + [0.4, 0.6, -1.0]]]), 0.1)); } @@ -228,7 +228,7 @@ fn learn_mixed_discrete_cim (pl: T) { } - let data = trajectory_generator(&net, 300, 300.0, Some(1234),); + let data = trajectory_generator(&net, 300, 300.0, Some(6347747169756259),); let (CIM, M, T) = pl.fit(&net, &data, 2, None); print!("CIM: {:?}\nM: {:?}\nT: {:?}\n", CIM, M, T); assert_eq!(CIM.shape(), [9, 4, 4]); @@ -244,7 +244,7 @@ fn learn_mixed_discrete_cim (pl: T) { [[-2.0, 1.0, 0.6, 0.4], [2.6, -7.1, 1.4, 3.1], [5.0, 1.0, -8.0, 2.0], [1.4, 0.4, 0.2, -2.0]], [[-3.0, 1.0, 1.5, 0.5], [3.0, -6.0, 1.0, 2.0], [0.3, 0.5, -1.9, 1.1], [5.0, 1.0, 2.0, -8.0]], [[-2.6, 0.6, 0.2, 1.8], [2.0, -6.0, 3.0, 1.0], [0.1, 0.5, -1.3, 0.7], [0.8, 0.6, 0.2, -1.6]], - ]), 0.3)); + ]), 0.1)); } #[test] diff --git a/tests/params.rs b/tests/params.rs index 255aba6..b049d4e 100644 --- a/tests/params.rs +++ b/tests/params.rs @@ -23,7 +23,7 @@ fn test_uniform_generation() { let param = create_ternary_discrete_time_continous_param(); let mut states = Array1::::zeros(10000); - let mut rng = ChaCha8Rng::seed_from_u64(123456); + let mut rng = ChaCha8Rng::seed_from_u64(6347747169756259); states.mapv_inplace(|_| { if let StateType::Discrete(val) = param.get_random_state_uniform(&mut rng) { @@ -42,7 +42,7 @@ fn test_random_generation_state() { let param = create_ternary_discrete_time_continous_param(); let mut states = Array1::::zeros(10000); - let mut rng = ChaCha8Rng::seed_from_u64(123456); + let mut rng = ChaCha8Rng::seed_from_u64(6347747169756259); states.mapv_inplace(|_| { if let StateType::Discrete(val) = param.get_random_state(1, 0, &mut rng).unwrap() { @@ -63,7 +63,7 @@ fn test_random_generation_residence_time() { let param = create_ternary_discrete_time_continous_param(); let mut states = Array1::::zeros(10000); - let mut rng = ChaCha8Rng::seed_from_u64(123456); + let mut rng = ChaCha8Rng::seed_from_u64(6347747169756259); states.mapv_inplace(|_| param.get_random_residence_time(1, 0, &mut rng).unwrap()); diff --git a/tests/tools.rs b/tests/tools.rs index fc9b930..76847ef 100644 --- a/tests/tools.rs +++ b/tests/tools.rs @@ -36,7 +36,7 @@ fn run_sampling() { } } - let data = trajectory_generator(&net, 4, 1.0, Some(1234),); + let data = trajectory_generator(&net, 4, 1.0, Some(6347747169756259),); assert_eq!(4, data.trajectories.len()); assert_relative_eq!(1.0, data.trajectories[0].time[data.trajectories[0].time.len()-1]);