Skip to content

Commit 82d10f7

Browse files
committed
wasserstein barycenetr with fixed support
1 parent bed7559 commit 82d10f7

File tree

1 file changed

+79
-7
lines changed

1 file changed

+79
-7
lines changed

docs/source/quickstart.rst

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,7 @@ More details about the algorithm used is given in the following note.
216216
:any:`ot.smooth.smooth_ot_semi_dual` with parameter :code:`reg_type='kl'` to
217217
choose entropic/Kullbach Leibler regularization.
218218

219-
.. hint::
220-
Examples of use for :any:`ot.sinkhorn` are available in the following examples:
221219

222-
- :any:`auto_examples/plot_OT_2D_samples`
223-
- :any:`auto_examples/plot_OT_1D`
224-
- :any:`auto_examples/plot_OT_1D_smooth`
225-
- :any:`auto_examples/plot_stochastic`
226220

227221

228222
Recently [23]_ introduced the sinkhorn divergence that build from entropic
@@ -234,6 +228,15 @@ empirical distributions.
234228
Finally note that we also provide in :any:`ot.stochastic` several implementation
235229
of stochastic solvers for entropic regularized OT [18]_ [19]_.
236230

231+
.. hint::
232+
Examples of use for :any:`ot.sinkhorn` are available in the following examples:
233+
234+
- :any:`auto_examples/plot_OT_2D_samples`
235+
- :any:`auto_examples/plot_OT_1D`
236+
- :any:`auto_examples/plot_OT_1D_smooth`
237+
- :any:`auto_examples/plot_stochastic`
238+
239+
237240
Other regularization
238241
^^^^^^^^^^^^^^^^^^^^
239242

@@ -335,10 +338,79 @@ relies on :any:`ot.sinkhorn` for its iterations.
335338
- :any:`auto_examples/plot_optim_OTreg`
336339

337340

338-
339341
Wasserstein Barycenters
340342
-----------------------
341343

344+
A Wasserstein barycenter is a distribution that minimize its Wasserstein
345+
distance with respect to other distributions [16]_. It corresponds to minimizing the
346+
following problem by seaching a distribution :math:`\mu`
347+
348+
.. math::
349+
\min_\mu \quad \sum_{k} w_kW(\mu,\mu_k)
350+
351+
352+
In practice we model a distribution with a finite number of support position:
353+
354+
.. math::
355+
\mu=\sum_{i=1}^n a_i\delta_{x_i}
356+
357+
where :math:`a` is an histogram on the simplex and the :math:`\{x_i\}` are the
358+
position of the support. We can clearly see here that optimizing :math:`\mu` can
359+
be done by searching for optimal weights :math:`a` or optimal support
360+
:math:`\{x_i\}` (optimizing both is also an option).
361+
We provide in POT solvers to estimate a discrete
362+
Wasserstein barycenter in both cases.
363+
364+
Barycenters with fixed support
365+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
366+
367+
When optimizing a barycenter with a fixed support, the optimization problem can
368+
be expressed as
369+
370+
371+
.. math::
372+
\min_a \quad \sum_{k} w_k W(a,b_k)
373+
374+
where :math:`b_k` are also weights in the simplex. In the non-regularized case,
375+
the problem above is a classical linear program. In this case we propose a
376+
solver :any:`ot.lp.barycenter` that rely on generic LP solvers. By default the
377+
function uses :any:`scipy.optimize.linprog`, but more efficient LP solvers from
378+
cvxopt can be also used by changing parameter :code:`solver`. Note that these
379+
solver require to solve a very large linear program and can be very slow in
380+
practice.
381+
382+
Similarly to the OT problem, OT barycenters can be computed in the regularized
383+
case. When using entropic regularization the problem can be solved with a
384+
generalization of the sinkhorn algorithm based on bregman projections [3]_. This
385+
algorithm is provided in function :any:`ot.bregman.barycenter` also available as
386+
:any:`ot.barycenter`. In this case, the algorithm scales better to large
387+
distributions and rely only on matrix multiplications that can be performed in
388+
parallel.
389+
390+
In addition to teh speedup brought by regularization, one can also greatly
391+
accelerate the estimation of Wasserstein barycenter when the support has a
392+
separable structure [21]_. In teh case of 2D images for instance one can replace
393+
the matrix vector production in teh bregman projections by convolution
394+
operators. We provide an implementation of this algorithm in function
395+
:any:`ot.bregman.convolutional_barycenter2d`.
396+
397+
.. hint::
398+
Example of Wasserstein (:any:`ot.lp.barycenter`) and regularized wassrestein
399+
barycenter (:any:`ot.bregman.barycenter`) computation are available in the following examples:
400+
401+
- :any:`auto_examples/plot_barycenter_1D`
402+
- :any:`auto_examples/plot_barycenter_lp_vs_entropic`
403+
404+
Example of convolutional barycenter (:any:`ot.bregman.convolutional_barycenter2d`) computation for 2D images is available
405+
in the following example:
406+
407+
- :any:`auto_examples/plot_convolutional_barycenter`
408+
409+
410+
411+
Barycenters with free support
412+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
413+
342414

343415

344416

0 commit comments

Comments
 (0)