https://github.com/alcrene/sdde-dimensionality
Some code exploring the dimensionality on nonlinear SDDEs (stochastic delay differential equations)
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.6%) to scientific vocabulary
Repository
Some code exploring the dimensionality on nonlinear SDDEs (stochastic delay differential equations)
Basic Info
- Host: GitHub
- Owner: alcrene
- License: mpl-2.0
- Language: Jupyter Notebook
- Default Branch: master
- Size: 339 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
The code in this repository was created in part as experiment for creating
a computational framework combining different tools in the Python ecosystem,
namely Luigi,
functools's lru_cache and multiprocessing.
I make no apologies for any hacks or clunky design.
Motivation
This code was created to ease the numerical exploration of stochastic delay differential equations. It was motivated by the need to compute statistics over large numbers of stochastic realizations.
Main features
To facilitate the calculation of empirical statistics for stochastic equations, this package provides
- Simple definition of new models with a single line of code.
- On-disk caching of system realizations.
- Parallelized generation of realizations.
- Memory-efficient statistics over large numbers of realizations: realizations are never in memory all at once, and so can be arbitrarily many.
- Cached computation of statistics to eliminate the cost of keeping realizations after the first calculation.
- Parallelized disk access to offset the disk-access cost for the initial calculations of statistics.
In addition, models can optionally be computed using Theano (see below), allowing for automatic differentiation and translation to C code.
Installation
For the most part, this package can be installed through pip. After navigating
to the local directory to which it was cloned, the usual command
pip install -e .
will install it along with the required packages. I assume that you will want to
make changes to the code; otherwise the -e part of the command may be omitted.
Although not necessary, we recommend installing this package within a virtual environment.
Currently missing dependencies
At present this code requires two packages which are yet public because they
are tied to a manuscript in preparation (these are indicated in setup.py.)
You can obtain these by contacting me directly at alexandre (dot) rene (at) caesar (dot) de.
Progress bars
By default, when running in a notebook, we use the progress bars from
tqdm_notebook. These provide better integration with the notebook, but require
that Jupyter Widgets be installed
(instructions found here).
If it is unavailable, you can switch to the vanilla tqdm progress bars; to do
so, open init.py and change the line
'tqdmimport': "from tqdm import tqdm_notebook as tqdm"
to
'tqdmimport': "from tqdm import tqdm"
Combining with machine learning tools
Although models are computed using NumPy by default, they can be computed with Theano instead. This allows for a substantial acceleration of simulation time thanks to the automatic translation and compilation to C code. Enabling Theano can be done by adding the line
shim.load_theano()
before instantiating the model. The Comparison Theano vs Numpy notebook demonstrates that we can get 10-fold
speed improvements this way.
Using Theano also makes available a rich library of machine learning tools for which it forms a basis. One can thus make use of this to perform automatic differentiation, maximum-likelihood, MCMC sampling, etc.
Example notebooks
A notebooks directory is included, which contain Jupyter notebooks. These
provide example uses of this code base and illustrate some of its features.
Currently there are two:
- Comparison Theano vs Numpy: Shows that enabling Theano can provide substantial acceleration when integrating differential equations.
- Linearized tanh: Analysis of a nonlinear SDDE with delayed sigmoidal
feedback. Illustrates the use of the
Realizationsclass, along with in-memory caching of statistics.
Owner
- Name: Alexandre René
- Login: alcrene
- Kind: user
- Repositories: 3
- Profile: https://github.com/alcrene
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total 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
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
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- luigi *
- mackelab_tools *
- matplotlib *
- numpy *
- scipy *
- sinn *
- theano_shim *
- tqdm *