Skip to main content

Scalable and simulation-free training of latent SDEs via score matching (Bartosh et al., 2025)

Project description

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:

  1. Move to the folder where you want the code
  2. Clone this repository: git clone https://github.com/simoneiriksson/SDEMatching.git
  3. If you prefer, create new python environment: python -m venv .venv
  4. And activate the new python environment: source .venv/bin/activate
  5. Install the package into your active environment: pip install -e .

References

  1. 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.

  2. 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.

  3. 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.

  4. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdematching-0.1.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sdematching-0.1.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file sdematching-0.1.1.tar.gz.

File metadata

  • Download URL: sdematching-0.1.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sdematching-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67be76cb7fc21dc9f578a7dd813afc47ca8735c9718832e8a7fd03d082160084
MD5 4f67dbda2d0670376ef1c5d2816aec1f
BLAKE2b-256 b4f3cdf32744c249847bdd8d1b96c6850d452e97f687aa347e8a13d8720d66a1

See more details on using hashes here.

File details

Details for the file sdematching-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sdematching-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for sdematching-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ad1fc8410c4fa7f0f7354d777b9696f849543687a11a527aa0af5eeb3c4c055
MD5 c8a9cb7a53581fb328d7c5be5e62b756
BLAKE2b-256 9ee833b90b479c8158973537ff872b3eb6e5e23bf74112fc99888358cb211648

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page