From e95ec87dad833d1c26acd30a1004fe76bd78e1a7 Mon Sep 17 00:00:00 2001 From: Patryk Mikulski Date: Sun, 21 Apr 2024 13:19:59 +0200 Subject: [PATCH] fix: predictions calculation using n_samples instead of m_channels --- pyPTE/core/pyPTE.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyPTE/core/pyPTE.py b/pyPTE/core/pyPTE.py index 5b5d814..4507e6a 100644 --- a/pyPTE/core/pyPTE.py +++ b/pyPTE/core/pyPTE.py @@ -154,10 +154,10 @@ def compute_PTE(phase: npt.NDArray, delay: int) -> npt.NDArray: max_dim_ypr_y_x = max(ypr.max(), y.max(), x.max()) + 1 P_ypr_y_x = np.zeros([max_dim_ypr_y_x, max_dim_ypr_y_x, max_dim_ypr_y_x]) - P_y /= m - delay - P_ypr_y /= m - delay - P_y_x /= m - delay - P_ypr_y_x /= m - delay + P_y /= n - delay + P_ypr_y /= n - delay + P_y_x /= n - delay + P_ypr_y_x /= n - delay Hy = -np.nansum(np.multiply(P_y, np.log2(P_y))) Hypr_y = -np.nansum(np.nansum(np.multiply(P_ypr_y, np.log2(P_ypr_y))))