Skip to content

Commit 8b7b545

Browse files
committed
fix flows config in flow doc example
1 parent b151635 commit 8b7b545

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/src/tutorials/flows.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ For this, we will need a more "expressive" variational family that is capable of
157157
## Normalizing Flow Variational Family
158158

159159
Now, let's try to optimize over a variational family formed by normalizing flows.
160-
Normalizing flows, or *flow* for short, is a class of parametric models leveraging neural networks for density estimation.
160+
Normalizing flows, or *flows* for short, is a class of parametric models leveraging neural networks for density estimation.
161161
(For a detailed tutorial on flows, refer to the review by Papamakarios *et al.*[^PNRML2021])
162162
Within the Julia ecosystem, the package [`NormalizingFlows`](https://github.com/TuringLang/NormalizingFlows.jl) provides a collection of popular flow models.
163-
In this example, we will use the popular `RealNVP` flow model[^DSB2017].
163+
In this example, we will use the popular `RealNVP`[^DSB2017].
164164
We will use a standard Gaussian base distribution with three layers, each with 16 hidden units.
165165

166166
[^PNRML2021]: Papamakarios, G., Nalisnick, E., Rezende, D. J., Mohamed, S., & Lakshminarayanan, B. (2021). Normalizing flows for probabilistic modeling and inference. *Journal of Machine Learning Research*, 22(57), 1-64.
@@ -171,7 +171,9 @@ using Functors
171171
172172
@leaf MvNormal
173173
174-
q_flow = realnvp(MvNormal(zeros(d), I); paramtype=Float64)
174+
n_layers = 3
175+
hidden_dims = [16, 16]
176+
q_flow = realnvp(MvNormal(zeros(d), I), hidden_dims, n_layers; paramtype=Float64)
175177
nothing
176178
```
177179

0 commit comments

Comments
 (0)