SDEmatching
This repo implements the 2025 paper SDE Matching: Scalable and Simulation-Free Training of Latent Stochastic Differential Equations, by Bartosh, Vetrov, and Naesseth [1]. The paper shows that it is possible to train a Stochastic Differential Equation (SDE) to fit data in a simulation free manner, by score matching between the trained model and a variational data approximation.
Score matching SDEs against variational approximation
For rendered equations see the GitHub page
Implementation
Ideas for further research
As explained above, the main obstacle with this model is how to construct the variational process. I have tried with a transformer model, which works for non-hidden states, but collapses when working with hidden latent dimensions.
In contrast, I have used a Gaussian Process, which generates an estimate of the mean and variance, but also generates an estimate of the derivative of the mean, and the variance of the derivative of the mean. This works very well for a simple physics system with restrictions to the drift matrix.
However, none of these generalizes. In the original paper, the authors use the ODE-RNN introduced by Rubanova et al. in 2. I personally do not like this approach, since it breaks with the simulation free spirit of the SDE matching method.
My suggestion for further research would be to use a 1D convolutional network that maps from observation_dim * series_length to latent_dim * series_length and then perhaps use a deep kernel 3 for further refinement.
How to run
In order to use the SDEMatching package do the following:
- Move to the folder where you want the code
- Clone this repository:
git clone https://github.com/simoneiriksson/SDEMatching.git - If you prefer, create new python environment:
python -m venv .venv - And activate the new python environment:
source .venv/bin/activate - Install the package into your active environment:
pip install -e .
References
-
Bartosh, G., Vetrov, D. & Naesseth, C.A.. (2025). SDE Matching: Scalable and Simulation-Free Training of Latent Stochastic Differential Equations. Proceedings of the 42nd International Conference on Machine Learning, in Proceedings of Machine Learning Research 267:3054-3070 Available from https://proceedings.mlr.press/v267/bartosh25a.html.
-
Yulia Rubanova, Ricky T. Q. Chen, and David Duvenaud. 2019. Latent ODEs for irregularly-sampled time series. Proceedings of the 33rd International Conference on Neural Information Processing Systems. Curran Associates Inc., Red Hook, NY, USA, Article 478, 5320–5330.
-
Wilson, A.G., Hu, Z., Salakhutdinov, R. & Xing, E.P.. (2016). Deep Kernel Learning. Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, in Proceedings of Machine Learning Research 51:370-378 Available from https://proceedings.mlr.press/v51/wilson16.html.
-
Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., & Poole, B. (2020). Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456.
Metadata
Release files for SDEmatching 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 | |
|---|---|---|---|
| sdematching-0.1.1.tar.gz | 22.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sdematching-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.1 kB
Release files / sdematching-0.1.1.tar.gz
| Download URL | sdematching-0.1.1.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67be76cb7fc21dc9f578a7dd813afc47ca8735c9718832e8a7fd03d082160084
|
|
BLAKE2b-256 checksum How to use checksums |
b4f3cdf32744c249847bdd8d1b96c6850d452e97f687aa347e8a13d8720d66a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / sdematching-0.1.1-py3-none-any.whl
| Download URL | sdematching-0.1.1-py3-none-any.whl |
|---|---|
| Size | 22.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ad1fc8410c4fa7f0f7354d777b9696f849543687a11a527aa0af5eeb3c4c055
|
|
BLAKE2b-256 checksum How to use checksums |
9ee833b90b479c8158973537ff872b3eb6e5e23bf74112fc99888358cb211648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|