Skip to content

Commit c6ae498

Browse files
committed
make jupyter notebooks downloadable
1 parent 16a97e2 commit c6ae498

File tree

7 files changed

+142
-60
lines changed

7 files changed

+142
-60
lines changed

_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ bibliography: bibliography.bib
4242
csl: apa.csl
4343

4444
execute:
45-
freeze: auto
45+
freeze: auto

exercises.qmd

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
title: "Exercises"
33
---
44

5+
To run the exercise notebooks, download them first: Open the notebook on this website, then click on "Other formats" $\rightarrow$ "Jupyter" on the right side of the page.
6+
57
## Generative neural networks
68

79
Here you can download example notebooks related to creating your own generative neural network architectures.
810

911
### Normalizing flow
1012

11-
- Peek online: [here](./exercises/normalizing-flow.ipynb){target="_blank"}
12-
- Download notebook: [here](./exercises/normalizing-flow.ipynb){download="normalizing-flow.ipynb"}
13+
- Notebook [here](./exercises/normalizing-flow.ipynb){target="_blank"}
1314

1415
In this exercise, you will build a normalizing flow based on affine coupling from scratch using `keras`, that will learn to transform the [moons distribution](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_moons.html) into a standard normal.
1516

@@ -24,8 +25,7 @@ Normalizing flow
2425

2526
### Flow matching - Datasaurus
2627

27-
- Peek online: [here](./exercises/flow-matching-datasaurus.ipynb){target="_blank"}
28-
- Download notebook: [here](./exercises/flow-matching-datasaurus.ipynb){download="flow-matching-datasaurus.ipynb"}
28+
- Notebook [here](./exercises/flow-matching-datasaurus.ipynb){target="_blank"}
2929
- Download data: [here](./data/datasaurus.csv){download="datasaurus.csv"}
3030

3131
In this exercise, you will build a flow matching model using `keras` that transports a standard normal distribution into a distribution based on the [datasaurus](https://en.wikipedia.org/wiki/Datasaurus_dozen).
@@ -39,7 +39,7 @@ Flow matching
3939

4040
### Flow matching - mirroring the Swiss roll
4141

42-
- Peek online: [here](./exercises/flow-matching-swiss-roll.ipynb){target="_blank"}
42+
- Notebook [here](./exercises/flow-matching-swiss-roll.ipynb){target="_blank"}
4343
- Download notebook: [here](./exercises/flow-matching-swiss-roll.ipynb){download="flow-matching-swiss-roll.ipynb"}
4444

4545
In this exercise, you will expand the flow matching model so that you can condition the distribution on contextual variables. This will enable you to learn a flow that transports a doghnut distribution into the [swiss roll distribution](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_swiss_roll.html), mirrored along horizontal and vertical axes, depending on the context.
@@ -54,17 +54,15 @@ Swiss roll mirrored along vertical or horizontal axes
5454

5555
Please visit the BayesFlow repository to find a [bunch of examples](https://github.com/bayesflow-org/bayesflow?tab=readme-ov-file#getting-started) that can help you with BayesFlow. In addition, below are two exercise notebooks you can use to familiarize yourself with BayesFlow.
5656

57-
### Estimating the mean and variance of a gaussian variable
57+
### Estimating parameters of a normal distribution
5858

59-
- Peek online: [here](./exercises/bayesflow-normal.ipynb){target="_blank"}
60-
- Download notebook: [here](./exercises/bayesflow-normal.ipynb){download="bayesflow-normal.ipynb"}
59+
- Notebook [here](./exercises/bayesflow-normal.ipynb){target="_blank"}
6160

6261
This notebook provides you with the very basics of the BayesFlow workflow - starting with defining simulators, through defining and training the neural approximators, and ending with network validation and inference.
6362

6463
### Wald response times, Racing diffusion model
6564

66-
- Peek online: [here](./exercises/bayesflow-diffusion.ipynb){target="_blank"}
67-
- Download notebook: [here](./exercises/bayesflow-diffusion.ipynb){download="bayesflow-diffusion.ipynb"}
65+
- Notebook [here](./exercises/bayesflow-diffusion.ipynb){target="_blank"}
6866
- Download data: [here](./data/forstmann.csv){download="forstmann.csv"}
6967

7068
This notebook provides you with a basic application of BayesFlow in the context of models of decision making - the Wald model of simple response times, and the racing diffusion model.

exercises/bayesflow-diffusion.ipynb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "raw",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "raw"
8+
}
9+
},
10+
"source": [
11+
"---\n",
12+
"title: Wald response times, Racing diffusion model\n",
13+
"format: \n",
14+
" html: default\n",
15+
" ipynb: default\n",
16+
"---"
17+
]
18+
},
19+
{
20+
"cell_type": "markdown",
21+
"metadata": {},
22+
"source": [
23+
"# Diffusion models in BayesFlow"
24+
]
25+
},
326
{
427
"cell_type": "code",
528
"execution_count": 1,

exercises/bayesflow-normal.ipynb

Lines changed: 64 additions & 48 deletions
Large diffs are not rendered by default.

exercises/flow-matching-datasaurus.ipynb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "raw",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "raw"
8+
}
9+
},
10+
"source": [
11+
"---\n",
12+
"format: \n",
13+
" html: default\n",
14+
" ipynb: default\n",
15+
"---"
16+
]
17+
},
318
{
419
"cell_type": "markdown",
520
"metadata": {},

exercises/flow-matching-swiss-roll.ipynb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "raw",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "raw"
8+
}
9+
},
10+
"source": [
11+
"---\n",
12+
"format: \n",
13+
" html: default\n",
14+
" ipynb: default\n",
15+
"---"
16+
]
17+
},
318
{
419
"cell_type": "markdown",
520
"metadata": {},
621
"source": [
7-
"## Flow matching with conditioning\n",
22+
"# Flow matching with conditioning\n",
823
"\n",
924
"In the previous exercises, we trained a normalizing flow and a flow matching models to reproduce one distribution.\n",
1025
"\n",

exercises/normalizing-flow.ipynb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "raw",
5+
"metadata": {
6+
"vscode": {
7+
"languageId": "raw"
8+
}
9+
},
10+
"source": [
11+
"---\n",
12+
"format: \n",
13+
" html: default\n",
14+
" ipynb: default\n",
15+
"---"
16+
]
17+
},
318
{
419
"cell_type": "markdown",
520
"metadata": {},

0 commit comments

Comments
 (0)