Skip to content

Commit 5aa4289

Browse files
Update README.md
1 parent fb6c805 commit 5aa4289

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,36 @@ losses = trainer.train_online(epochs=10, iterations_per_epoch=500, batch_size=32
5353
```
5454

5555
Before inference, we can use simulation-based calibration (SBC, https://arxiv.org/abs/1804.06788) to check the computational faithfulness of the model-amortizer combination:
56+
5657
```python
5758
fig = trainer.diagnose_sbc_histograms()
5859
```
59-
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_sbc.png" width=50% height=50%>
60+
61+
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_sbc.png" width=65% height=65%>
62+
6063
Amortized inference on new (real or simulated) data is then easy and fast:
64+
6165
```python
6266
# Simulate 200 new data sets and generate 500 posterior draws per data set
6367
new_sims = trainer.configurator(generative_model(200))
6468
posterior_draws = amortizer.sample(new_sims, n_samples=500)
6569
```
66-
We can then quickly inspect the parameter recoverability of the model
70+
71+
We can then quickly inspect the parameter recoverability of the model:
72+
6773
```python
6874
fig = bf.diagnostics.plot_recovery(posterior_draws, new_sims['parameters'])
6975
```
70-
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_recovery.png" width=50% height=50%>
71-
or look at single posteriors in relation to the prior:
76+
77+
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_recovery.png" width=65% height=65%>
78+
79+
Or we can look at single posteriors in relation to the prior:
80+
7281
```python
7382
fig = bf.diagnostics.plot_posterior_2d(posterior_draws[0], prior=generative_model.prior)
7483
```
75-
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_posterior.png" width=40% height=40%>
84+
85+
<img src="https://github.com/stefanradev93/BayesFlow/blob/Future/img/showcase_posterior.png" width=45% height=45%>
7686

7787
### Further Reading
7888

0 commit comments

Comments
 (0)