From 9232b73291f9d8d396498d7abfdb14278c69fdcc Mon Sep 17 00:00:00 2001 From: gcattan Date: Tue, 17 Dec 2024 21:49:20 +0100 Subject: [PATCH] Update distance.py --- pyriemann_qiskit/utils/distance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyriemann_qiskit/utils/distance.py b/pyriemann_qiskit/utils/distance.py index 60910207..ac6c49bb 100644 --- a/pyriemann_qiskit/utils/distance.py +++ b/pyriemann_qiskit/utils/distance.py @@ -111,7 +111,7 @@ def weights_logeuclid_to_convex_hull(A, B, optimizer=ClassicalOptimizer()): matrices = range(n_matrices) def log_prod(m1, m2): - return np.nansum(logm(m1).flatten() * logm(m2).flatten()) + return np.trace(logm(m1) @ logm(m2)) prob = Model() optimizer = get_global_optimizer(optimizer)