❄️ Polarized Consensus-Based Optimization and Sampling
This code produces the examples for the paper "Polarized consensus-based dynamics for optimization and sampling": https://arxiv.org/abs/2211.05238
@online{bungert2022polarized,
author = {Bungert, Leon and Roith, Tim and Wacker, Philipp},
title = {Polarized consensus-based dynamics for optimization and sampling},
year = {2022},
eprint={2211.05238},
archivePrefix={arXiv},
primaryClass={math.OC}
}
💡 What is PolarCBO/CBS?
Polarized consensus-based dynamics allow to apply consensus-based optimization (CBO) and sampling (CBS) for objective functions with several global minima or distributions with many modes, respectively. Here we have
- particles ${x^{(i)}}\in\mathbb{R}^d$ which explore the space,
- the objective $V:\mathbb{R}^d\to\mathbb{R}$ which we want to optimize.
For optimizing $V$ the position of the particles are updated via the stochastic ODE
$$ \begin{align} \boxed{% d x^{(i)} = -(x^{(i)} - m(x^{(i)})) d t + \sigma |x^{(i)} - m(x^{(i)})| d W^{(i)} } \end{align} $$
where
- $m(x^{(i)})$ is a weighted empirical mean associated with the point $x^{(i)}$,
- $W^{(i)}$ are independent Brownian motions,
- $\sigma$ scales the influence of the noise term.
For sampling from $\exp(-V)$ the position of the particles are updated via the stochastic ODE
$$ \begin{align} \boxed{% d x^{(i)} = -(x^{(i)} - m(x^{(i)})) d t + \sqrt{2\lambda^{-1}C(x^{(i)})} d W^{(i)} } \end{align} $$
where $C(x^{(i)})$ is a weighted empirical covariance matrix associated with the point $x^{(i)}$.
The choice of the functions $m(\dot)$ and $C(\cdot)$ are at the heart of our polarized methods. Given a similarity measure $\mathsf k(\cdot,\cdot)$ and an inverse temperature parameter $\beta>0$ we define
$$ \begin{align} m(x) &:= \frac{\sum_{i}\mathsf k(x,x^{(i)})x^{(i)}\exp(-\beta V(x^{(i)}))}{\sum_{i}\mathsf k(x,x^{(i)})\exp(-\beta V(x^{(i)}))}, \ C(x) &:= \frac{\sum_{i}\mathsf k(x,x^{(i)})(x^{(i)}-m(x))\otimes(x^{(i)}-m(x))\exp(-\beta V(x^{(i)}))}{\sum_{i}\mathsf k(x,x^{(i)})\exp(-\beta V(x^{(i)}))}. \end{align} $$
Note that these weighted mean and covariance give more influence to particles which are close to $x$ and have a small value of $V$. If $\mathsf k(\cdot,\cdot)=1$ one recovers standard CBO and CBS.
Metadata
Release files for polarcbo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polarcbo-0.1.1.tar.gz | 10.3 kB | Without provenance | Details for polarcbo-0.1.1.tar.gz |
Release files / polarcbo-0.1.1.tar.gz
| Download URL | polarcbo-0.1.1.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4e10ba17977473b8f3feeeaa24fb9c8142fda21fb4e5b23a87929e660c78014
|
|
BLAKE2b-256 checksum How to use checksums |
14bff32dc3a2944e1bdf50b8bfc9a00ab2e96b4e820ed146c1e78aa7748f391b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.12
|
Security for polarcbo 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.