Skip to content

Commit 62ff1bd

Browse files
authored
Merge pull request #99 from slimgroup/add_docs
add manual path to imgs
2 parents 4a294e4 + 36fc07f commit 62ff1bd

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

docs/src/examples.md

+11-18
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We provide usage examples for all the layers and network in our [examples](https
44

55
## 2D Rosenbrock/banana distribution sampling w/ GLOW
66

7-
```@example banana
7+
```@example
88
using LinearAlgebra, InvertibleNetworks, PyPlot, Flux, Random
99
1010
# Random seed
@@ -49,8 +49,6 @@ function backward(ΔX, X)
4949
return ΔX, X
5050
end
5151
52-
####################################################################################################
53-
5452
# Loss
5553
function loss(X)
5654
Y, logdet = forward(X)
@@ -97,20 +95,21 @@ ax3 = subplot(2,2,3); plot(X_[1, 1, 1, :], X_[1, 1, 2, :], "g."); title(L"Data s
9795
ax3.set_xlim([-3.5,3.5]); ax3.set_ylim([0,50])
9896
ax4 = subplot(2,2,4); plot(Y[1, 1, 1, :], Y[1, 1, 2, :], "."); title(L"Latent space: $z \sim \hat{p}_Z$")
9997
ax4.set_xlim([-3.5, 3.5]); ax4.set_ylim([-3.5, 3.5])
100-
savefig("plot_banana.svg")
98+
savefig("../src/figures/plot_banana.svg")
99+
101100
nothing
102101
```
103-
![plot_banana.svg](plot_banana.svg)
104-
105-
106-
102+
![plot_banana.svg](figures/plot_banana.svg)
107103

108104

109105
## Conditional 2D Rosenbrock/banana distribution sampling w/ cHINT
110106

111107
```@example cbanana
112108
using InvertibleNetworks
113-
using Flux, LinearAlgebra, PyPlot
109+
using Flux, LinearAlgebra, PyPlot, Random
110+
111+
# Random seed
112+
Random.seed!(11)
114113
115114
# Define network
116115
nx = 1; ny = 1; n_in = 2
@@ -204,17 +203,11 @@ ax9.set_xlim([-3.5, 3.5]); ax9.set_ylim([-3.5, 3.5])
204203
ax10 = subplot(2,5,10); plot(Zx[1, 1, 1, :], Zx[1, 1, 2, :], ".");
205204
plot(Zy_fixed[1, 1, 1, :], Zy_fixed[1, 1, 2, :], "r."); title(L"Latent space: $zx \sim \hat{p}_{zx}$")
206205
ax10.set_xlim([-3.5, 3.5]); ax10.set_ylim([-3.5, 3.5])
207-
savefig("plot_cbanana.svg")
206+
savefig("../src/figures/plot_cbanana.svg")
207+
208208
nothing
209209
```
210-
![plot_cbanana.svg](plot_cbanana.svg)
211-
212-
213-
214-
215-
216-
217-
210+
![plot_cbanana.svg](figures/plot_cbanana.svg)
218211

219212

220213
## Literature applications

0 commit comments

Comments
 (0)