This repo is for our preprint Reconstructing dynamics from sparse observations with no training on target system, where dynamics be faithfully reconstructed from the limited observations without any training data. This framework provides a paradigm of reconstructing complex and nonlinear dynamics in the extreme situation where training data does not exist and the observations are random and sparse.
We address this challenge by developing a hybrid transformer and reservoir-computing machine-learning scheme. For a complex and nonlinear target system, the training of the transformer can be conducted not using any data from the target system, but with essentially unlimited synthetic data from known chaotic systems. The trained transformer is then tested with the sparse data from the target system. The output of the transformer is further fed into a reservoir computer for predicting the long-term dynamics or the attractor of the target system.
Download the time series data of all chaotic systems from Zenodo and move them to the 'chaos_data' folder. You can also generate the chaotic data by running save_chaos.py
. To proceed with the machine learning code, either download the data and move it to the 'chaos_data' folder or generate the data yourself.
Run chaos_transformer_read_and_test.py
to evaluate the trained model on testing (target) systems, with sequence length
Afterward, execute rc_prediction.py
to use the Transformer-reconstructed data to make both short-term and long-term predictions:
In addition, we provide code chaos_transformer_train.py
for readers to train the transformer, please remember to change the 'save_file_name' in chaos_transformer_read_and_test.py
to your saved model file name to ensure the use of your own trained model when doing testing.
- For more information about the hyperparameters optimization, you can find from my GitHub page.
@article{zhai2024reconstructing,
title={Reconstructing dynamics from sparse observations with no training on target system},
author={Zhai, Zheng-Meng and Huang, Jun-Yin and Stern, Benjamin D. and Lai, Ying-Cheng},
journal={arXiv preprint arXiv:2410.21222},
year={2024}
}