training vi and normalizing flows wip\
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
trainings/variational_inference_core_team/img/dafuq.jpg
Normal file
BIN
trainings/variational_inference_core_team/img/dafuq.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
BIN
trainings/variational_inference_core_team/img/easydist.png
Normal file
BIN
trainings/variational_inference_core_team/img/easydist.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 772 KiB |
BIN
trainings/variational_inference_core_team/img/plate-vae.png
Normal file
BIN
trainings/variational_inference_core_team/img/plate-vae.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
93
trainings/variational_inference_core_team/vae.ipynb
Normal file
93
trainings/variational_inference_core_team/vae.ipynb
Normal 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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user