Skip to content

Commit

Permalink
Merge pull request #5 from moldyn/Fix-numerical-issue-for-small-numbe…
Browse files Browse the repository at this point in the history
…r-of-samples

Fix beartype warning for almost I=0 but negative
  • Loading branch information
braniii authored Mar 11, 2024
2 parents 28b8216 + e70b9ce commit eff9c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/normi/_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def kraskov_estimator(
mean_log_eps: Float = np.mean(np.log(radii))

return (
digamma_N + digamma_k - digamma_nx - digamma_ny, # mi
np.max([digamma_N + digamma_k - digamma_nx - digamma_ny, 0]), # mi
digamma_N - digamma_k + (dx + dy) * mean_log_eps, # hxy
digamma_N - digamma_nx + dx * mean_log_eps, # hx
digamma_N - digamma_ny + dy * mean_log_eps, # hy
Expand Down

0 comments on commit eff9c20

Please sign in to comment.