|
|
|
@ -47,7 +47,7 @@ fn learn_binary_cim<T: ParameterLearning> (pl: T) { |
|
|
|
|
assert!(CIM.abs_diff_eq(&arr3(&[ |
|
|
|
|
[[-1.0, 1.0], [4.0, -4.0]], |
|
|
|
|
[[-6.0, 6.0], [2.0, -2.0]], |
|
|
|
|
]), 0.2)); |
|
|
|
|
]), 0.3)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
@ -101,7 +101,7 @@ fn learn_ternary_cim<T: ParameterLearning> (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.2)); |
|
|
|
|
]), 0.3)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -154,7 +154,7 @@ fn learn_ternary_cim_no_parents<T: ParameterLearning> (pl: 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.2)); |
|
|
|
|
[0.4, 0.6, -1.0]]]), 0.3)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -244,7 +244,7 @@ fn learn_mixed_discrete_cim<T: ParameterLearning> (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.2)); |
|
|
|
|
]), 0.3)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|