Skip to content

Commit 4366c27

Browse files
authored
Add new notebooks (#61)
1 parent 69f17c1 commit 4366c27

18 files changed

Lines changed: 1639 additions & 3408 deletions

docs/_static/theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ h1 {
3535
margin-bottom: 50px;
3636
}
3737
h3, h2, h1 {
38-
font-weight: 300 !important;
38+
3939
}
4040

4141
nav > li > a > code.literal {

docs/index.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ License
110110
:maxdepth: 1
111111
:hidden:
112112

113-
Getting started <notebooks/introduction>
114-
SBI with sbijax <notebooks/sbi_with_sbijax>
115-
Neural networks <notebooks/neural_networks>
116-
Density estimators <notebooks/density_estimators>
117-
High-dimensional inference <notebooks/high_dimensional_inference>
118-
Figure styling <notebooks/figure_styling>
113+
Getting started <notebooks/getting_started>
114+
A more detailed intro <notebooks/more_detailed_intro>
115+
Examples <notebooks/examples>
116+
Inference using EEG data <notebooks/eeg_data_example>
119117

120118
.. toctree::
121119
:caption: 🚀 Examples

docs/notebooks/density_estimators.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"name": "python",
3030
"nbconvert_exporter": "python",
3131
"pygments_lexer": "ipython3",
32-
"version": "3.9.15"
32+
"version": "3.11.9"
3333
}
3434
},
3535
"nbformat": 4,

manuscript+supplement/experimental_code/chp5-real_data_example.ipynb renamed to docs/notebooks/eeg_data_example.ipynb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,6 @@
216216
"metadata": {},
217217
"outputs": [],
218218
"source": [
219-
"if not os.path.exists(\"figs\"):\n",
220-
" os.mkdir(\"figs\")\n",
221-
"\n",
222219
"color_closed = \"#700e01\"\n",
223220
"color_open = \"#c79999\""
224221
]
@@ -275,8 +272,7 @@
275272
" laxes[1].spines['left'].set_color('black')\n",
276273
" laxes[1].set_xlabel(\"Time\", fontsize=18)\n",
277274
" laxes[0].set_ylabel(\"Amplitude\", fontsize=18)\n",
278-
" laxes[0].yaxis.set_label_coords(-0.1, -0.1) \n",
279-
" plt.savefig(\"figs/real_data-data.pdf\", dpi=200)\n",
275+
" laxes[0].yaxis.set_label_coords(-0.1, -0.1) \n",
280276
" plt.show()\n",
281277
"\n",
282278
"with plt.style.context(\"sbijax\"):\n",
@@ -291,8 +287,7 @@
291287
" raxes.set_xlabel(\"Frequency [Hz]\", fontsize=18)\n",
292288
" raxes.set_ylabel(\"Power spectral density [dB]\", fontsize=18)\n",
293289
" raxes.legend(frameon=False, fontsize=18)\n",
294-
" raxes.grid(linewidth=0.5)\n",
295-
" plt.savefig(\"figs/real_data-periodogram.pdf\", dpi=200)\n",
290+
" raxes.grid(linewidth=0.5) \n",
296291
" plt.show()"
297292
]
298293
},
@@ -365,7 +360,6 @@
365360
" raxes.legend(frameon=False, fontsize=18)\n",
366361
" raxes.grid(linewidth=0.5)\n",
367362
" raxes.tick_params(axis='both',labelsize=13)\n",
368-
"plt.savefig(\"figs/real_data-all_data.pdf\", dpi=200)\n",
369363
"plt.show()"
370364
]
371365
},
@@ -864,7 +858,6 @@
864858
" fontsize=15,\n",
865859
" title_fontsize=16\n",
866860
")\n",
867-
"plt.savefig(\"figs/real_data-real_data_posteriors.pdf\", dpi=200)\n",
868861
"plt.show()"
869862
]
870863
},
@@ -938,7 +931,7 @@
938931
"name": "python",
939932
"nbconvert_exporter": "python",
940933
"pygments_lexer": "ipython3",
941-
"version": "3.11.7"
934+
"version": "3.11.9"
942935
}
943936
},
944937
"nbformat": 4,

manuscript+supplement/experimental_code/chp4-examples.ipynb renamed to docs/notebooks/examples.ipynb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# Examples\n",
99
"\n",
10-
"Here we implement the models given in the `Examples` section."
10+
"In the following, we demonstrate several `sbijax` methods using the complex \"Simple Liklelihood Complex Posterior\" model."
1111
]
1212
},
1313
{
@@ -47,9 +47,7 @@
4747
"outputs": [],
4848
"source": [
4949
"import warnings\n",
50-
"warnings.filterwarnings(\"ignore\")\n",
51-
"\n",
52-
"if not os.path.exists(\"figs\"): os.mkdir(\"figs\")"
50+
"warnings.filterwarnings(\"ignore\")"
5351
]
5452
},
5553
{
@@ -345,7 +343,6 @@
345343
" ax.yaxis.label.set_size(20)\n",
346344
" ax.tick_params(axis='both',labelsize=13)\n",
347345
"plt.tight_layout()\n",
348-
"plt.savefig(\"./figs/example-rhat_ress-slice.pdf\", dpi=200)\n",
349346
"plt.show()"
350347
]
351348
},
@@ -418,7 +415,6 @@
418415
"\n",
419416
"plot_ess_and_trace(slice_inference_data)\n",
420417
"plt.tight_layout()\n",
421-
"plt.savefig(\"./figs/example-triple_plot-slice.pdf\", dpi=200)\n",
422418
"plt.show()"
423419
]
424420
},
@@ -442,7 +438,6 @@
442438
"source": [
443439
"plot_posteriors(slice_samples.reshape(-1, 5))\n",
444440
"plt.tight_layout()\n",
445-
"plt.savefig(\"./figs/example-pair_plot-slice.pdf\", dpi=200)\n",
446441
"plt.show()"
447442
]
448443
},
@@ -562,7 +557,6 @@
562557
" inference_data_as_dictionary(snle_inference_results.posterior)[\"theta\"],\n",
563558
")\n",
564559
"plt.tight_layout()\n",
565-
"plt.savefig(\"./figs/example-pair_plot-snle.pdf\", dpi=200)\n",
566560
"plt.show()"
567561
]
568562
},
@@ -664,7 +658,6 @@
664658
" inference_data_as_dictionary(fmpe_inference_results.posterior)[\"theta\"],\n",
665659
")\n",
666660
"plt.tight_layout()\n",
667-
"plt.savefig(\"./figs/example-pair_plot-fmpe.pdf\", dpi=200)\n",
668661
"plt.show()"
669662
]
670663
},
@@ -780,7 +773,6 @@
780773
" inference_data_as_dictionary(smc_inference_results.posterior)[\"theta\"],\n",
781774
")\n",
782775
"plt.tight_layout()\n",
783-
"plt.savefig(\"./figs/example-pair_plot-smc.pdf\", dpi=200)\n",
784776
"plt.show()"
785777
]
786778
},
@@ -852,7 +844,7 @@
852844
"name": "python",
853845
"nbconvert_exporter": "python",
854846
"pygments_lexer": "ipython3",
855-
"version": "3.11.7"
847+
"version": "3.11.9"
856848
}
857849
},
858850
"nbformat": 4,

docs/notebooks/figure_styling.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
"name": "python",
357357
"nbconvert_exporter": "python",
358358
"pygments_lexer": "ipython3",
359-
"version": "3.9.15"
359+
"version": "3.11.9"
360360
}
361361
},
362362
"nbformat": 4,

0 commit comments

Comments
 (0)