Skip to content

Commit 3f9cb32

Browse files
committed
cosmetic fixed -- resolve linter complaints
1 parent 8a67c29 commit 3f9cb32

File tree

5 files changed

+16
-20
lines changed

5 files changed

+16
-20
lines changed

example/targets/banana.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@ $(FIELDS)
1515
The banana distribution is obtained by applying a transformation ϕ to a multivariate normal
1616
distribution ``\\mathcal{N}(0, \\text{diag}(var, 1, 1, …, 1))``. The transformation ϕ is defined as
1717
```math
18-
\phi(x_1, … , x_p) = (x_1, x_2 - B x_1^² + \text{var}*B, x_3, … , x_p)
19-
````
18+
\\phi(x_1, … , x_p) = (x_1, x_2 - B x_1^² + \\text{var}*B, x_3, … , x_p)
19+
```
2020
which has a unit Jacobian determinant.
2121
2222
Hence the density "fb" of a p-dimensional banana distribution is given by
2323
```math
24-
fb(x_1, \dots, x_p) = \exp\left[ -\frac{1}{2}\frac{x_1^2}{\text{var}} -
25-
\frac{1}{2}(x_2 + B x_1^2 - \text{var}*B)^2 - \frac{1}{2}(x_3^2 + x_4^2 + \dots
26-
+ x_p^2) \right] / Z,
24+
fb(x_1, \\dots, x_p) = \\exp\\left[ -\\frac{1}{2}\\frac{x_1^2}{\\text{var}} -
25+
\\frac{1}{2}(x_2 + B x_1^2 - \\text{var}*B)^2 - \\frac{1}{2}(x_3^2 + x_4^2 + \\dots
26+
+ x_p^2) \\right] / Z,
2727
```
2828
where "B" is the "banananicity" constant, determining the curvature of a banana, and
2929
``Z = \\sqrt{\\text{var} * (2\\pi)^p)}`` is the normalization constant.
3030
31-
3231
# Reference
3332
3433
Gareth O. Roberts and Jeffrey S. Rosenthal

example/targets/cross.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ The Cross distribution is a 2-dimension 4-component Gaussian distribution with a
1111
shape that is symmetric about the y- and x-axises. The mixture is defined as
1212
1313
```math
14-
\begin{aligned}
14+
\\begin{aligned}
1515
p(x) =
16-
& 0.25 \mathcal{N}(x | (0, \mu), (\sigma, 1)) + \\
17-
& 0.25 \mathcal{N}(x | (\mu, 0), (1, \sigma)) + \\
18-
& 0.25 \mathcal{N}(x | (0, -\mu), (\sigma, 1)) + \\
19-
& 0.25 \mathcal{N}(x | (-\mu, 0), (1, \sigma)))
20-
\end{aligned}
16+
& 0.25 \\mathcal{N}(x | (0, \\mu), (\\sigma, 1)) + \\\\
17+
& 0.25 \\mathcal{N}(x | (\\mu, 0), (1, \\sigma)) + \\\\
18+
& 0.25 \\mathcal{N}(x | (0, -\\mu), (\\sigma, 1)) + \\\\
19+
& 0.25 \\mathcal{N}(x | (-\\mu, 0), (1, \\sigma))
20+
\\end{aligned}
2121
```
2222
2323
where ``μ`` and ``σ`` are the mean and standard deviation of the Gaussian components,

example/targets/neal_funnel.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ $(FIELDS)
1313
The Neal's Funnel distribution is a p-dimensional distribution with a funnel shape,
1414
originally proposed by Radford Neal in [2].
1515
The marginal distribution of ``x_1`` is Gaussian with mean "μ" and standard
16-
deviation "σ". The conditional distribution of ``x_2, \dots, x_p | x_1`` are independent
16+
deviation "σ". The conditional distribution of ``x_2, \\dots, x_p | x_1`` are independent
1717
Gaussian distributions with mean 0 and standard deviation ``\\exp(x_1/2)``.
1818
The generative process is given by
1919
```math
20-
x_1 \sim \mathcal{N}(\mu, \sigma^2), \quad x_2, \ldots, x_p \sim \mathcal{N}(0, \exp(x_1))
20+
x_1 \\sim \\mathcal{N}(\\mu, \\sigma^2), \\quad x_2, \\ldots, x_p \\sim \\mathcal{N}(0, \\exp(x_1))
2121
```
2222
23-
2423
# Reference
2524
[1] Stan User’s Guide:
2625
https://mc-stan.org/docs/2_18/stan-users-guide/reparameterization-section.html#ref-Neal:2003

example/targets/warped_gaussian.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ $(FIELDS)
1313
The banana distribution is obtained by applying a transformation ϕ to a 2-dimensional normal
1414
distribution ``\\mathcal{N}(0, diag(\\sigma_1, \\sigma_2))``. The transformation ϕ(x) is defined as
1515
```math
16-
ϕ(x_1, x_2) = (r*\cos(\theta + r/2), r*\sin(\theta + r/2)),
16+
\\phi(x_1, x_2) = (r*\\cos(\\theta + r/2), r*\\sin(\\theta + r/2)),
1717
```
18-
where ``r = \\sqrt{x\_1^2 + x_2^2}``, ``\\theta = \\atan(x₂, x₁)``,
19-
and "atan(y, x) [-π, π]" is the angle, in radians, between the positive x axis and the
18+
where ``r = \\sqrt{x_1^2 + x_2^2}``, ``\\theta = \\atan(x_2, x_1)``,
19+
and ``\\atan(y, x) \\in [-\\pi, \\pi]`` is the angle, in radians, between the positive x axis and the
2020
ray to the point "(x, y)". See page 18. of [1] for reference.
2121
22-
2322
# Reference
2423
[1] Zuheng Xu, Naitong Chen, Trevor Campbell
2524
"MixFlows: principled variational inference via mixed flows."

src/NormalizingFlows.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Train the given normalizing flow `flow` by calling `optimize`.
2424
- `flow`: normalizing flow to be trained, we recommend to define flow as `<:Bijectors.TransformedDistribution`
2525
- `args...`: additional arguments for `vo`
2626
27-
2827
# Keyword Arguments
2928
- `max_iters::Int=1000`: maximum number of iterations
3029
- `optimiser::Optimisers.AbstractRule=Optimisers.ADAM()`: optimiser to compute the steps

0 commit comments

Comments
 (0)