Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions harmonic/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,20 @@ def cross_validation(
)
)
hm.logs.debug_log(
"cross_validation: evidence_inv = {}".format(ev.evidence_inv)
"cross_validation: evidence_inv = {}".format(np.exp(ev.ln_evidence_inv))
)
hm.logs.debug_log(
"cross_validation: evidence_inv_var = {}".format(ev.evidence_inv_var)
"cross_validation: evidence_inv_var = {}".format(np.exp(ev.ln_evidence_inv_var))
)
hm.logs.debug_log(
"cross_validation:"
+ " evidence_inv_var**0.5/evidence_inv = {}".format(
ev.evidence_inv_var**0.5 / ev.evidence_inv
+ " ln evidence_inv_var**0.5/evidence_inv = {}".format(
(ev.ln_evidence_inv_var*0.5) - ev.ln_evidence_inv
)
)
hm.logs.debug_log(
"cross_validation: evidence_inv_var_var = {}".format(
ev.evidence_inv_var_var
"cross_validation: ln_evidence_inv_var_var = {}".format(
ev.ln_evidence_inv_var_var
)
)

Expand Down
54 changes: 26 additions & 28 deletions notebooks/basic_usage.ipynb

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions notebooks/checkpointing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {
"id": "XSCBJ_S4XvDe"
},
"outputs": [],
"source": [
"%%capture\n",
"# Install packages\n",
"%pip install harmonic emcee corner getdist"
"if 'google.colab' in str(get_ipython()):\n",
" # Install packages\n",
" %pip install harmonic emcee corner getdist"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"id": "1OtVkBf7OAIF"
},
Expand All @@ -79,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"id": "8PgO6f4VQSpD"
},
Expand Down Expand Up @@ -130,7 +131,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {
"id": "xjsxOkX0QSzL"
},
Expand Down Expand Up @@ -161,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {
"id": "Ju_YJlk2QS7x"
},
Expand All @@ -187,7 +188,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {
"id": "us1kBuWlQZTy"
},
Expand All @@ -196,7 +197,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Training NF: 100%|██████████| 4/4 [01:45<00:00, 26.27s/it]\n"
"Training NF: 100%|██████████| 4/4 [01:09<00:00, 17.46s/it]\n"
]
}
],
Expand Down Expand Up @@ -270,7 +271,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {
"id": "Eel3bSORQZW0"
},
Expand All @@ -293,7 +294,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {
"id": "eSxxNW1KQZZc"
},
Expand Down Expand Up @@ -328,7 +329,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {
"id": "efPNgW8qQZcW"
},
Expand All @@ -348,7 +349,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {
"id": "WrB47hA3QZfM"
},
Expand All @@ -357,9 +358,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"ln_evidence_err_neg = -0.0031277022888513755\n",
"ln_evidence_err_pos = 0.0031179502607592245\n",
"ln_evidence_err_avg = 0.0031228262748053\n"
"ln_evidence_err_neg = -0.004000549204647541\n",
"ln_evidence_err_pos = 0.003984608221799135\n",
"ln_evidence_err_avg = 0.003992578946053982\n"
]
}
],
Expand All @@ -373,7 +374,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
Expand All @@ -386,9 +387,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"ln_evidence (harmonic) = 9.186614990234375 (+ 0.0031179502607592245 / -0.0031277022888513755)\n",
"ln_evidence (harmonic) = 9.188836097717285 (+ 0.003984608221799135 / -0.004000549204647541)\n",
"ln_evidence (analytic) = 9.189385332046726\n",
"nsigma = 0.887126458074755\n"
"nsigma = 0.13756379945435523\n"
]
}
],
Expand Down Expand Up @@ -418,7 +419,8 @@
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "hm_140",
"language": "python",
"name": "python3"
},
"language_info": {
Expand All @@ -431,7 +433,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.13.9"
}
},
"nbformat": 4,
Expand Down
Loading
Loading