This repository contains the code implementation for the paper "Identifying stochastic dynamics via Finite Expression Methods".
FEX-DM is a machine learning two-stage framework that models stochastic differential equations (OU process, Double Well Potential, etc).
FEX-DM is a two-stage framework for learning stochastic differential equations (SDEs):
- Stage 1 (Deterministic): Learn the drift term using Finite Expression (FEX) methods
- Stage 2 (Stochastic): Learn the diffusion term using neural networks
The framework can handle various SDE models including Ornstein-Uhlenbeck (OU) processes, Double Well Potential, and more.
- Python 3.8+
- PyTorch
- NumPy
- SciPy
- Matplotlib
- SymPy
- FAISS (for nearest neighbor search)
- Clone the repository:
git clone <repository-url>
cd FEX-DM- Set up environment:
Run config.py in the src folder. The required packages will be automatically installed.
python src/config.pyTrain the FEX model to learn the drift term:
python src/1stage_deterministic.pyTrain the neural network to learn the diffusion term:
python src/2stage_stochastic_time_independent.pyIf you use FEX-DM, please cite the following paper:
@article{LIANG2026114756,
title = {Identifying stochastic dynamics via finite expression methods},
journal = {Journal of Computational Physics},
volume = {554},
pages = {114756},
year = {2026},
issn = {0021-9991},
doi = {https://doi.org/10.1016/j.jcp.2026.114756},
url = {https://www.sciencedirect.com/science/article/pii/S0021999126001063},
author = {Senwei Liang and Chunmei Wang and Xingjian Xu},This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 Xingjian Xu and Senwei Liang
For questions, or issues:
- Email: [email protected], [email protected]
- Issues: Please use the GitHub Issues page for bug reports