training vi and normalizing flows wip\

This commit is contained in:
ritchie46
2019-10-09 15:54:41 +02:00
parent f9e66aa340
commit eebd9b5e3d
7 changed files with 561 additions and 517 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,93 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Variational Autoencoders\n",
"\n",
"A Bayesian approach\n",
"\n",
"\n",
"## Suddenly a wild fashion-set appears...\n",
"<img src=\"img/fashion-mnist-sprite.png\"/>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Generative model\n",
"\n",
"<img src=\"./img/plate-vae.png\"/>\n",
"\n",
"For each image $x_i$:\n",
"\n",
"$$\\begin{eqnarray}\n",
"z_i &\\sim& P(z) \\\\\n",
"x_i &\\sim& P(x|z_i)\n",
"\\end{eqnarray}$$\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Bayesian inference\n",
"\n",
"$$P(z|x) = \\frac{P(x|z)P(z)}{P(x)} $$\n",
"\n",
"## Can we solve this with MCMC?\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Approximate distribution\n",
"\n",
"Let's define an approximate distribution $Q(Z) \\approx P(z|x)$. We optimize the variables of $Q(z)$ so that it will be 'closer' to the true posterior $P(z|x)$\n",
"\n",
"<img src=\"./img/easydist.png\"/>\n",
"\n",
"<img src=\"./img/dafuq.jpg\"/>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## KL-divergence\n",
"There is a reason we choose to measure the 'closeseness' with the KL-divergence and not a real distance metric, such as the Wasserstein distance."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}