From 414aa3186711b36613bd8980c6860435fac12257 Mon Sep 17 00:00:00 2001 From: AlessandroBregoli Date: Mon, 5 Dec 2022 09:21:37 +0100 Subject: [PATCH] Bugfix --- reCTBN/src/parameter_learning.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reCTBN/src/parameter_learning.rs b/reCTBN/src/parameter_learning.rs index 2aa518c..3f505f9 100644 --- a/reCTBN/src/parameter_learning.rs +++ b/reCTBN/src/parameter_learning.rs @@ -144,6 +144,12 @@ impl ParameterLearning for BayesianApproach { .zip(M.mapv(|x| x as f64).axis_iter(Axis(2))) .for_each(|(mut C, m)| C.assign(&(&m.mapv(|y| y + alpha) / &T.mapv(|y| y + tau)))); + + CIM.outer_iter_mut() + .for_each(|mut C| { + C.diag_mut().fill(0.0); + }); + //Set the diagonal of the inner matrices to the the row sum multiplied by -1 let tmp_diag_sum: Array2 = CIM.sum_axis(Axis(2)).mapv(|x| x * -1.0); CIM.outer_iter_mut()