Skip to content

Commit dbf1bbf

Browse files
Exampled tested and updated
1 parent 733ce34 commit dbf1bbf

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

example/real_nvp.ipynb

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
"b = torch.Tensor([1 if i % 2 == 0 else 0 for i in range(latent_size)])\n",
4141
"flows = []\n",
4242
"for i in range(K):\n",
43-
" s = nf.nets.MLP([latent_size, 2 * latent_size, latent_size], init_zeros=True)#, output_fn=\"tanh\", output_scale=3.)\n",
44-
" t = nf.nets.MLP([latent_size, 2 * latent_size, latent_size], init_zeros=True)#, output_fn=\"tanh\", output_scale=3.)\n",
43+
" s = nf.nets.MLP([latent_size, 2 * latent_size, latent_size], init_zeros=True)\n",
44+
" t = nf.nets.MLP([latent_size, 2 * latent_size, latent_size], init_zeros=True)\n",
4545
" if i % 2 == 0:\n",
4646
" flows += [nf.flows.MaskedAffineFlow(b, s, t)]\n",
4747
" else:\n",
@@ -135,8 +135,6 @@
135135
" log_prob = nfm.log_prob(zz).to('cpu').view(*xx.shape)\n",
136136
" prob = torch.exp(log_prob)\n",
137137
" prob[torch.isnan(prob)] = 0\n",
138-
" #np.save('/scratch2/vs488/lectures/aml/optimization/log/no_annealing_real_nvp_prob_%06i.npy' % (it + 1),\n",
139-
" # prob.data.numpy())\n",
140138
"\n",
141139
" plt.figure(figsize=(15, 15))\n",
142140
" plt.pcolormesh(xx, yy, prob.data.numpy())\n",
@@ -167,18 +165,11 @@
167165
"plt.gca().set_aspect('equal', 'box')\n",
168166
"plt.show()"
169167
]
170-
},
171-
{
172-
"cell_type": "code",
173-
"execution_count": null,
174-
"metadata": {},
175-
"outputs": [],
176-
"source": []
177168
}
178169
],
179170
"metadata": {
180171
"kernelspec": {
181-
"display_name": "Python 3",
172+
"display_name": "Python 3 (ipykernel)",
182173
"language": "python",
183174
"name": "python3"
184175
},
@@ -192,7 +183,7 @@
192183
"name": "python",
193184
"nbconvert_exporter": "python",
194185
"pygments_lexer": "ipython3",
195-
"version": "3.7.6"
186+
"version": "3.8.11"
196187
}
197188
},
198189
"nbformat": 4,

0 commit comments

Comments
 (0)