deterministicparticleflowcontrol
Repository for Deterministic Particle Flow Control framework
https://github.com/dimitra-maoutsa/deterministicparticleflowcontrol
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, mdpi.com, aps.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Keywords
Repository
Repository for Deterministic Particle Flow Control framework
Basic Info
- Host: GitHub
- Owner: dimitra-maoutsa
- License: mit
- Language: Python
- Default Branch: main
- Homepage: http://deterministicparticleflowcontrol.readthedocs.io/
- Size: 42.3 MB
Statistics
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 6
- Releases: 3
Topics
Metadata Files
README.md
Setting | Documentation | Installation | Main functionality | Cite us | References | Ask a question
Deterministic Particle Flow Control
Repository for the Deterministic Particle Flow Control framework
- Link to published article: :newspaper: Phys. Rev. Research 4, 043035
- Link to poster: :bar_chart: poster
- Link to documendation: :scroll: readthedocs
[ This is work together with Manfred Opper funded by the SFB 1294. ]
[ PyPI package includes only numpy implementation, the github repository here provides both numpy and pytorch functionalities. ]
Description:
Obtaining optimal interventions for stochastic nonlinear systems is a computationally demanding process requiring the solution of nonlinear partial differential equations. Here we build on the Path Integral control formalism to derive a noniterative framework that represents the solutions of the underlying partial differential equations in terms of deterministic particle flows.
Setting:
We consider a stochastic system described by a stochastic differential equation (SDE)
with drift f(x,t) and diffusion σ(x,t).
We want to constrain the dynamics of this system for a time interval
- either to reach some target state
at time T (terminal constraint),
- and/or to visit/avoid specific regions of the state space (path constraints).
We implement the constraints in terms a time- and state-dependent perturbation of the deterministic part of the dynamics, i.e. we apply interventions u(x,t) and the controlled system dynamics become
.
Following the assumptions of the Path Integral control formalism, i.e. assuming that control costs are inversely proportional of noise variance (see paper for more details), we can show that the interventions u(x,t) can be obtained from the logarithmic gradient of the solution of a backward linear partial differential equation rescaled by the noise variance.
Here, instead of solving the backward PDE to obtain the optimal drift adjustment that implements the constraints, we express the optimal interventions as the difference of the logarithmic gradient of two probability flows, and
. The probability flow or density
satisfies the forward filtering equation, a forward PDE that in the absence of path constraints is the Fokker--Planck equation of the uncontrolled dynamics, while
is the marginal constrained density that in turn satisfies the Fokker--Planck equation of the optimally controlled dynamics.
Installation:
To install the install the software through Pypi run the following commands
```python
Create and activate a new virtualenvironment
python -m venv venv source venv/bin/activate pip install DeterministicParticleFlowControl ```
or to install from the downloaded repository run
```python
Create and activate a new virtualenvironment
python -m venv venv source venv/bin/activate
install the depndencies
pip install -r requirements.txt pip install -e ./ ```
Main functionality: DPFC
To obtain the time dependent control functions create an instance of DPFC
python
from DeterministicParticleFlowControl import DPFC
control_flows = DPFC(t1,t2,y1,y2,f,g,N,M,reweight, U,dens_est,reject,kern='RBF',f_true=None,brown_bridge=False)
where
- t1, t2 : are define the timeinterval [t1,t2] within which the constraints are imposed onto the system,
- y1, y2 : are the initial and target state,
- f : is the drift function of the uncontrolled system,
- g : is the diffusion coefficient (can be scalar or matrix),
- N : the number of particles that will be employed for sampling the flows,
- M : inducing point number for the sparse kernel estimation of the logarithmic gradients,
- reweight: boolean indicating whether reweighting of forward trajectories is necessary, i.e. when:
- path constraints are relevant for the problem,
- the target is a non typical system state and the forward flow will be sampled as a reweighted Brownian bridge,
- U : function handle representing the path constraints, i.e. , for pushing the controlled trajectories towards the sin(t) line. Expects two arguments, so even if path constraint is non timedependent add an extra dummy variable in the argument list,
-
dens_est : idicator determining the method to be employed for the logarithmic gradient (score) estimation. Currently supported:
- nonparametric : for nonparametric sparse kernel estimation,
- reject : boolean variable determining whether rejection of backward trajectories failing to reach the initial condition will take place
(this is mostly used as an indicator of numerical instabilities - if everything runs smoothly 1 or 2 trajectories need to be deleted, but often none of them
if more trajectories get deleted, then rerun the computation with more particles N)
- kern : the kernel that will be employed for the nonparametric logarithmic gradient estimation of the sampled densities. Currently supported:
- RBF : radial basis function kernel with lengthscale estimated at every time step from the samples,
f_true: function handler of system drift function when the reweighted Brownian bridge functionality for forward sampling is used. In that case,fshould be supplied with the drift function of the brownian bridge,Ushould be set to the necessary path constraint (see paper), andreweightandbrown_bridgeshould be turned to True,brown_bridge: boolean variable indicating whether the sampling of the forward flow will happen with reweighted Brownian bridge dynamics.
This returns an object that contains the sampled flows and control functions. To compute the controls for the timestep ti when the system is at state x call
python
u = control_flows.calculate_u(x,ti)
Cite us:
The method is introduced in this paper. To cite it:
``` @article{maoutsa2022deterministic, title = {Deterministic particle flows for constraining stochastic nonlinear systems}, author = {Maoutsa, Dimitra and Opper, Manfred}, journal = {Phys. Rev. Research}, volume = {4}, issue = {4}, pages = {043035}, numpages = {17}, year = {2022}, month = {Oct}, publisher = {American Physical Society}, doi = {10.1103/PhysRevResearch.4.043035}, url = {https://link.aps.org/doi/10.1103/PhysRevResearch.4.043035} }
```
Further references:
[1] Dimitra Maoutsa, Manfred Opper. "Deterministic particle flows for constraining stochastic nonlinear systems". 2021. [Physical review Research]
[2] Dimitra Maoutsa, Manfred Opper. "Deterministic particle flows for constraining SDEs". 2021. [Machine Learning and the Physical Sciences, Workshop at the 35th Conference on Neural Information Processing Systems (NeurIPS)]
[3] Dimitra Maoutsa, Sebastian Reich, Manfred Opper. "Interacting particle solutions of Fokker–Planck equations through gradient–log–density estimation". 2021. [Entropy]
Owner
- Name: Dimitra Maoutsa
- Login: dimitra-maoutsa
- Kind: user
- Location: Berlin
- Company: Technical University of Berlin
- Website: https://dimitra-maoutsa.gitlab.io/
- Twitter: _dim_ma_
- Repositories: 5
- Profile: https://github.com/dimitra-maoutsa
Physics-inspired computational and data-analysis methods for neuro and more. @TU-Berlin, previously @MPIDS
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it using these metadata."
authors:
- family-names: "Maoutsa"
given-names: "Dimitra"
affiliation: "Technical University of Berlin"
orcid: "https://orcid.org/0000-0002-3553-8658"
title: "DeterministicParticleFlowControl"
version: 0.3.2
date-released: 2021-12-29
url: "https://pypi.org/project/DeterministicParticleFlowControl/0.3.2/"
preferred-citation:
type: article
authors:
- family-names: "Maoutsa"
given-names: "Dimitra"
orcid: "https://orcid.org/0000-0002-3553-8658"
affiliation: "Technical University of Berlin, and University of Potsdam"
- family-names: "Opper"
given-names: "Manfred"
journal: "arXiv preprint arXiv:2112.05735"
title: "Deterministic particle flows for constraining stochastic nonlinear systems"
year: 2021
GitHub Events
Total
Last Year
Committers
Last synced: almost 3 years ago
All Time
- Total Commits: 582
- Total Committers: 2
- Avg Commits per committer: 291.0
- Development Distribution Score (DDS): 0.002
Top Committers
| Name | Commits | |
|---|---|---|
| Dimitra Maoutsa | m****d@h****r | 581 |
| lgtm-com[bot] | 4****]@u****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 7
- Total pull requests: 21
- Average time to close issues: 3 days
- Average time to close pull requests: about 1 hour
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.29
- Average comments per pull request: 0.29
- Merged pull requests: 20
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- dimitra-maoutsa (7)
Pull Request Authors
- dimitra-maoutsa (20)
- lgtm-com[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 3 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 1
- Total maintainers: 1
pypi.org: deterministicparticleflowcontrol
DeterministicParticleFlowControl: deterministic particle based stochastic optimal control framework
- Homepage: https://github.com/dimitra-maoutsa/DeterministicParticleFlowControl
- Documentation: https://deterministicparticleflowcontrol.readthedocs.io/
- License: MIT
-
Latest release: 0.3.2
published about 4 years ago
Rankings
Maintainers (1)
Dependencies
- coveralls * development
- flake8 * development
- pytest ==4.6.3 development
- pytest-cov * development
- POT *
- duecredit *
- ipython *
- matplotlib *
- nbsphinx *
- numba *
- numpy *
- numpydoc *
- pyemd ==0.5.1
- rst2pdf *
- scipy *
- seaborn *
- sphinx *
- sphinx-copybutton *
- sphinx-gallery *
- sphinx-readable-theme *
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite