Skip to content

Commit

Permalink
fix: (crucial) swapped dimensions in PTE calculation
Browse files Browse the repository at this point in the history
* fix: (crucial) swapped dimensions in PTE calculation

* fix: predictions calculation using n_samples instead of m_channels
  • Loading branch information
patrk authored Apr 21, 2024
1 parent eeb59fc commit 3ca8e9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyPTE/core/pyPTE.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down

0 comments on commit 3ca8e9b

Please sign in to comment.