Skip to content

Commit

Permalink
Deploying to gh-pages from @ 06e0a15 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneCmb committed Sep 3, 2024
1 parent 9b3fd0c commit dacf1f5
Show file tree
Hide file tree
Showing 116 changed files with 896 additions and 157 deletions.
Binary file modified _downloads/071683bb9f5d321841ee9dd62eee27a4/plot_sim_red_syn.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/1e58f0eaeee8456990c2959bfc1babe9/plot_oinfo.zip
Binary file not shown.
Binary file modified _downloads/31d2b25c7ef60a5789246c25d83787c6/plot_ml_vs_it.zip
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

# %%

import numpy as np

from hoi.core import get_entropy
Expand All @@ -34,7 +35,7 @@
# list of estimators to compare
metrics = {
"GC": get_entropy("gc"),
"Gaussian": get_entropy("gauss"),
"Gaussian": get_entropy(method="gauss"),
"KNN-3": get_entropy("knn", k=3),
"Kernel": get_entropy("kernel"),
}
Expand Down
Binary file modified _downloads/4edd620b8310fd78193d26c454d1ca13/plot_rsi.zip
Binary file not shown.
Binary file modified _downloads/58edfc8265b6af8f03b242ea4656b10f/plot_syn_phiID.zip
Binary file not shown.
Binary file not shown.
Binary file modified _downloads/69a8436c098192f96580d8e9cd2f5d4d/plot_entropies.zip
Binary file not shown.
Binary file modified _downloads/6df867479300c4bb75728e18f2fcc139/plot_infotopo.zip
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion _downloads/7aa0a86e987814b09694d9eac79452ec/plot_mi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
4. See if the computed MI converge toward the theoretical value
"""

# %%

import numpy as np
from functools import partial

Expand All @@ -35,10 +37,10 @@
# create a special function for the binning approach as it requires binary data
mi_binning_fcn = get_mi("binning", base=2)


def mi_binning(x, y, **kwargs):
x = digitize(x.T, **kwargs).T
y = digitize(y.T, **kwargs).T

return mi_binning_fcn(x, y)


Expand Down
Binary file not shown.
Binary file modified _downloads/9b8182d6a0423d2c5a54190326bb52f0/plot_jax.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"# list of estimators to compare\nmetrics = {\n \"GC\": get_entropy(\"gc\"),\n \"Gaussian\": get_entropy(\"gauss\"),\n \"KNN-3\": get_entropy(\"knn\", k=3),\n \"Kernel\": get_entropy(\"kernel\"),\n}\n\n# number of samples to simulate data\nn_samples = np.geomspace(20, 1000, 15).astype(int)\n\n# number of repetitions to estimate the percentile interval\nn_repeat = 10\n\n\n# plotting function\ndef plot(h_x, h_theoric):\n \"\"\"Plotting function.\"\"\"\n for n_m, metric_name in enumerate(h_x.keys()):\n # get the entropies\n x = h_x[metric_name]\n\n # get the color\n color = f\"C{n_m}\"\n\n # estimate lower and upper bounds of the [5, 95]th percentile interval\n x_low, x_high = np.percentile(x, [5, 95], axis=0)\n\n # plot the entropy as a function of the number of samples and interval\n plt.plot(n_samples, x.mean(0), color=color, lw=2, label=metric_name)\n plt.fill_between(n_samples, x_low, x_high, color=color, alpha=0.2)\n\n # plot the theoretical value\n plt.axhline(\n h_theoric, linestyle=\"--\", color=\"k\", label=\"Theoretical entropy\"\n )\n plt.legend()\n plt.xlabel(\"Number of samples\")\n plt.ylabel(\"Entropy [bits]\")"
"# list of estimators to compare\nmetrics = {\n \"GC\": get_entropy(\"gc\"),\n \"Gaussian\": get_entropy(method=\"gauss\"),\n \"KNN-3\": get_entropy(\"knn\", k=3),\n \"Kernel\": get_entropy(\"kernel\"),\n}\n\n# number of samples to simulate data\nn_samples = np.geomspace(20, 1000, 15).astype(int)\n\n# number of repetitions to estimate the percentile interval\nn_repeat = 10\n\n\n# plotting function\ndef plot(h_x, h_theoric):\n \"\"\"Plotting function.\"\"\"\n for n_m, metric_name in enumerate(h_x.keys()):\n # get the entropies\n x = h_x[metric_name]\n\n # get the color\n color = f\"C{n_m}\"\n\n # estimate lower and upper bounds of the [5, 95]th percentile interval\n x_low, x_high = np.percentile(x, [5, 95], axis=0)\n\n # plot the entropy as a function of the number of samples and interval\n plt.plot(n_samples, x.mean(0), color=color, lw=2, label=metric_name)\n plt.fill_between(n_samples, x_low, x_high, color=color, alpha=0.2)\n\n # plot the theoretical value\n plt.axhline(\n h_theoric, linestyle=\"--\", color=\"k\", label=\"Theoretical entropy\"\n )\n plt.legend()\n plt.xlabel(\"Number of samples\")\n plt.ylabel(\"Entropy [bits]\")"
]
},
{
Expand Down
Binary file not shown.
Binary file modified _downloads/cb54325e1a49091788b29a83388e5628/plot_mi.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion _downloads/f14e92090ebeb63084124f7809315b90/plot_mi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"# create a special function for the binning approach as it requires binary data\nmi_binning_fcn = get_mi(\"binning\", base=2)\n\n\ndef mi_binning(x, y, **kwargs):\n x = digitize(x.T, **kwargs).T\n y = digitize(y.T, **kwargs).T\n return mi_binning_fcn(x, y)\n\n\n# list of estimators to compare\nmetrics = {\n \"GC\": get_mi(\"gc\", biascorrect=False),\n \"KNN-3\": get_mi(\"knn\", k=3),\n \"KNN-10\": get_mi(\"knn\", k=10),\n \"Kernel\": get_mi(\"kernel\"),\n \"Binning\": partial(mi_binning, n_bins=4),\n}\n\n# number of samples to simulate data\nn_samples = np.geomspace(20, 1000, 10).astype(int)\n\n# number of repetitions to estimate the percentile interval\nn_repeat = 10\n\n\n# plotting function\ndef plot(mi, mi_theoric):\n \"\"\"Plotting function.\"\"\"\n for n_m, metric_name in enumerate(mi.keys()):\n # get the entropies\n x = mi[metric_name]\n\n # get the color\n color = f\"C{n_m}\"\n\n # estimate lower and upper bounds of the [5, 95]th percentile interval\n x_low, x_high = np.percentile(x, [5, 95], axis=0)\n\n # plot the MI as a function of the number of samples and interval\n plt.plot(n_samples, x.mean(0), color=color, lw=2, label=metric_name)\n plt.fill_between(n_samples, x_low, x_high, color=color, alpha=0.2)\n\n # plot the theoretical value\n plt.axhline(mi_theoric, linestyle=\"--\", color=\"k\", label=\"Theoretical MI\")\n plt.legend()\n plt.xlabel(\"Number of samples\")\n plt.ylabel(\"Mutual-information [bits]\")"
"# create a special function for the binning approach as it requires binary data\nmi_binning_fcn = get_mi(\"binning\", base=2)\n\ndef mi_binning(x, y, **kwargs):\n x = digitize(x.T, **kwargs).T\n y = digitize(y.T, **kwargs).T\n\n return mi_binning_fcn(x, y)\n\n\n# list of estimators to compare\nmetrics = {\n \"GC\": get_mi(\"gc\", biascorrect=False),\n \"KNN-3\": get_mi(\"knn\", k=3),\n \"KNN-10\": get_mi(\"knn\", k=10),\n \"Kernel\": get_mi(\"kernel\"),\n \"Binning\": partial(mi_binning, n_bins=4),\n}\n\n# number of samples to simulate data\nn_samples = np.geomspace(20, 1000, 10).astype(int)\n\n# number of repetitions to estimate the percentile interval\nn_repeat = 10\n\n\n# plotting function\ndef plot(mi, mi_theoric):\n \"\"\"Plotting function.\"\"\"\n for n_m, metric_name in enumerate(mi.keys()):\n # get the entropies\n x = mi[metric_name]\n\n # get the color\n color = f\"C{n_m}\"\n\n # estimate lower and upper bounds of the [5, 95]th percentile interval\n x_low, x_high = np.percentile(x, [5, 95], axis=0)\n\n # plot the MI as a function of the number of samples and interval\n plt.plot(n_samples, x.mean(0), color=color, lw=2, label=metric_name)\n plt.fill_between(n_samples, x_low, x_high, color=color, alpha=0.2)\n\n # plot the theoretical value\n plt.axhline(mi_theoric, linestyle=\"--\", color=\"k\", label=\"Theoretical MI\")\n plt.legend()\n plt.xlabel(\"Number of samples\")\n plt.ylabel(\"Mutual-information [bits]\")"
]
},
{
Expand Down
Binary file modified _downloads/f599913a46208f71dc47a6311a232f10/plot_syn_red_mmi.zip
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions _modules/hoi/core/combinatory.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_gc.html">hoi.core.entropy_gc</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_gauss.html">hoi.core.entropy_gauss</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_bin.html">hoi.core.entropy_bin</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_hist.html">hoi.core.entropy_hist</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_knn.html">hoi.core.entropy_knn</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.entropy_kernel.html">hoi.core.entropy_kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../api/generated/hoi.core.prepare_for_it.html">hoi.core.prepare_for_it</a></li>
Expand Down
Loading

0 comments on commit dacf1f5

Please sign in to comment.