Commit 8c438bdf by Matthieu Boileau

### Remove useless lines

parent 4a0cf3d7
 ... ... @@ -39,7 +39,6 @@ "from matplotlib import pyplot as plt\n", "from ipywidgets import interact, fixed, FloatSlider, RadioButtons\n", "rcParams['figure.figsize'] = (8., 6.) # Enlarge figure\n", "rcParams['animation.html'] = 'html5' # to render animation in notebook\n", "# A slider for p\n", "slider = FloatSlider(min=-1., max=2., step=0.1, value=1.1, continuous_update=False)\n", "\n", ... ...
 %% Cell type:markdown id: tags: # Course of Dario Trevisan: Optimal transport %% Cell type:markdown id: tags: We solve the earth movers problem using the [POT](https://pot.readthedocs.io/en/stable/index.html) library. First, some python initializations. %% Cell type:code id: tags: ``` python %matplotlib inline from matplotlib import rcParams from matplotlib import pyplot as plt from ipywidgets import interact, fixed, FloatSlider, RadioButtons rcParams['figure.figsize'] = (8., 6.) # Enlarge figure rcParams['animation.html'] = 'html5' # to render animation in notebook # A slider for p slider = FloatSlider(min=-1., max=2., step=0.1, value=1.1, continuous_update=False) from earth_movers import EarthMovers1D, EarthMovers2D ``` %% Cell type:markdown id: tags: ## 1D case Solve the earth movers problem for 50-position samples. %% Cell type:code id: tags: ``` python em1D = EarthMovers1D(50) interact(em1D.plot_ot, p=slider, plot_points=fixed(True)); ``` %% Cell type:markdown id: tags: ## 2D case Solve the earth movers problem for 50-position samples. %% Cell type:code id: tags: ``` python em2D = EarthMovers2D(100) interact(em2D.plot_ot, p=slider, plot_points=fixed(True)); ``` %% Cell type:markdown id: tags: Solve the earth movers problem for 1000-position samples. %% Cell type:code id: tags: ``` python em2D_large = EarthMovers2D(1000) interact(em2D_large.plot_ot, p=slider, plot_points=fixed(False)); ``` %% Cell type:markdown id: tags: ## Histogram of distance %% Cell type:markdown id: tags: Plot the histogram of distance for 2000-position samples on the 1D and 2D problems. %% Cell type:code id: tags: ``` python def plot_histogram(dimension=2, p=1.1): nsim = 2000 em = EarthMovers1D(nsim) if dimension == 1 else EarthMovers2D(nsim) return em.plot_distance_histogram(p, bins=20) interact(plot_histogram, dimension=RadioButtons(options=[1, 2], value=2), p=slider); ``` %% Cell type:markdown id: tags: ## Todo - Uniform random blue and red points on a square # - Its optimal mathching, with p=1, n=500 # - Histogram of matching length in d=1,2,3 # - one dimensional matching for p=1.1 and p=0.9, comparison - The scaling algorithm for local optimal matching PoT: ... ...
 ... ... @@ -37,7 +37,6 @@ "from matplotlib import pyplot as plt\n", "from ipywidgets import interact, FloatSlider, RadioButtons\n", "rcParams['figure.figsize'] = (8., 6.) # Enlarge figure\n", "rcParams['animation.html'] = 'html5' # to render animation in notebook\n", "slider = FloatSlider(min=0., max=1., step=0.1, value=0.5, continuous_update=False)\n", "\n", "from percolation import PercolationRect, PercolationHex, percolation_vs_p, PercolationRectDual" ... ...
 %% Cell type:markdown id: tags: # Course of Sébastien Martineau: Percolation %% Cell type:markdown id: tags: First, some python initializations. %% Cell type:code id: tags: ``` python %matplotlib inline from matplotlib import rcParams from matplotlib import pyplot as plt from ipywidgets import interact, FloatSlider, RadioButtons rcParams['figure.figsize'] = (8., 6.) # Enlarge figure rcParams['animation.html'] = 'html5' # to render animation in notebook slider = FloatSlider(min=0., max=1., step=0.1, value=0.5, continuous_update=False) from percolation import PercolationRect, PercolationHex, percolation_vs_p, PercolationRectDual ``` %% Cell type:markdown id: tags: ## Rectangular lattice %% Cell type:code id: tags: ``` python percorect = PercolationRect(20, 10) interact(percorect.plot, p=slider); ``` %% Cell type:markdown id: tags: ## Hexagonal lattice %% Cell type:code id: tags: ``` python percohex = PercolationHex(5, 5) percohex.compute_clusters(0.2) percohex.plot_clusters(add_cluster_id=True) ``` %% Cell type:code id: tags: ``` python percohex15 = PercolationHex(30, 30) interact(percohex15.plot, p=slider); ``` %% Cell type:markdown id: tags: ## Probability of crossing as a function of \$p\$ Based on 300 simulations on a \$25 \times 25\$ lattice. %% Cell type:code id: tags: ``` python percolation_vs_p(25, 25, nsim=300) ``` %% Cell type:markdown id: tags: ## Initial and dual graph for a rectangular percolation %% Cell type:code id: tags: ``` python perco = PercolationRectDual(5) interact(perco.plot_graph, p=slider, graph_type=RadioButtons(options=['initial', 'dual', 'both'])); ``` %% Cell type:markdown id: tags: ## Todo - Standard coupling on honeycomb lattice, - Duality of honycomb lattice - Standard coupling on square lattice and its dual # - Monte Carlo for crossing probabilities on square lattice, threshold phenomena # - Monte Carlo for crossing probabilities on honeycomb lattice - Percolation on 4 regular trees - Percolation on free group with 2 generators # - Percolation on the dual of seven triangular tilling hex cells: graphs: networkx ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!