Commit 47fa9fba authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Rename some notebooks

parent c05616bf
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Earth movers\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"source": [
"First, some python initializations."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"autoscroll": false,
"ein.hycell": false,
"ein.tags": "worksheet-0",
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from matplotlib import rcParams\n",
"from matplotlib import pyplot as plt\n",
"from ipywidgets import interact\n",
"import ipywidgets as widgets\n",
"rcParams['figure.figsize'] = (8., 6.) # Enlarge figure\n",
"rcParams['animation.html'] = 'html5' # to render animation in notebook"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Solve the earth movers problem for 50-position samples."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from earth_movers import EarthMovers\n",
"\n",
"em = EarthMovers(50)\n",
"em.plot_ot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Plot histogram of distance for 2000-position samples."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"em2000 = EarthMovers(2000)\n",
"print(f\"Wasserstein distance: {em2000.get_wasserstein_distance():f}\")\n",
"em2000.plot_distance_histogram(bins=20)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Todo\n",
"\n",
"- Uniform random blue and red points on a square #\n",
"- Its optimal mathching, with p=1, n=500 #\n",
"- Histogram of matching length in d=1,2,3 #\n",
"- one dimensional matching for p=1.1 and p=0.9, comparison\n",
"- The scaling algorithm for local optimal matching\n",
"\n",
"PoT: <https://pot.readthedocs.io/en/stable/auto_examples/plot_OT_2D_samples.html>"
]
}
],
"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.4"
},
"name": "mc2020.ipynb",
"toc": {
"base_numbering": 1,
"nav_menu": {
"height": "120px",
"width": "252px"
},
"number_sections": false,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": null,
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}
This diff is collapsed.
......@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Course of Sébastien Martineau: percolation"
"# Course of Sébastien Martineau: Percolation"
]
},
{
......
......@@ -9,7 +9,7 @@
}
},
"source": [
"# Course of Marielle Simon: simple random walk"
"# Course of Marielle Simon: Simple random walk"
]
},
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment