A Python package for Koopman theory using deep learning.
Koopman theory is a mathematical technique to achieve data-driven approximations of nonlinear dynamical systems by encoding them into a linear space. dlkoopman
uses deep learning to learn such an encoding, while simultaneously learning the linear dynamics.
- State prediction (
StatePred
) - Train on individual states (snapshots) of a system, then predict unknown states.- E.g: What is the pressure vector on this aircraft for
$23.5^{\circ}$ angle of attack?
- E.g: What is the pressure vector on this aircraft for
- Trajectory prediction (
TrajPred
) - Train on generated trajectories of a system, then predict unknown trajectories for new initial states.- E.g: What is the behavior of this pendulum if I start from the point
$[1,-1]$ ?
- E.g: What is the behavior of this pendulum if I start from the point
- General and reusable - supports data from any dynamical system.
- Novel error function Average Normalized Absolute Error (ANAE) for visualizing performance.
- Extensive options and a ready-to-use hyperparameter search module to improve performance.
- Built using Pytorch, supports both CPU and GPU platforms.
We bridge the gap between a) software packages that restrict the learning of a good linearizable encoding (e.g. pykoopman
), and b) efforts that learn encodings for specific applications instead of being a general tool (e.g. DeepKoopman
).
pip install dlkoopman
git clone https://github.com/GaloisInc/dlkoopman.git
cd dlkoopman
pip install .
DLKoopman can also be run as a docker container by pulling the image from galoisinc/dlkoopman:<version>
, e.g. docker pull galoisinc/dlkoopman:v1.0.2
.
Available in the examples
folder.
Available at https://galoisinc.github.io/dlkoopman/.
Assume a dynamical system
For a thorough mathematical treatment, see this technical report.
This is a small example with three input states
Errors mimimized during training:
- Train the autoencoder - Reconstruction
recon
between$x$ and$\hat{x}$ . - Train the Koopman matrix - Linearity
lin
between$y$ and$\mathsf{y}$ . - Combine the above - Prediction
pred
between$x$ and$\hat{\mathsf{x}}$ .
Prediction happens after training.
(a) State prediction - Compute predicted states for new indexes such as
(b) Trajectory prediction - Generate predicted trajectories
Some common issues and ways to overcome them are described in the known issues.
Please cite the accompanying paper:
@article{Dey2022_dlkoopman,
author = {Sourya Dey and Eric William Davis},
title = {DLKoopman: A deep learning software package for Koopman theory},
journal = {arXiv preprint arXiv:2211.08992},
year = {2022},
note = {Submitted to 5th Annual Learning for Dynamics & Control (L4DC) Conference}
}
- B. O. Koopman - Hamiltonian systems and transformation in Hilbert space
- J. Nathan Kutz, Steven L. Brunton, Bingni Brunton, Joshua L. Proctor - Dynamic Mode Decomposition
- Bethany Lusch, J. Nathan Kutz & Steven L. Brunton - Deep learning for universal linear embeddings of nonlinear dynamics
This material is based upon work supported by the United States Air Force and DARPA under Contract No. FA8750-20-C-0534. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Air Force and DARPA. Distribution Statement A, "Approved for Public Release, Distribution Unlimited."