Roy Friedman, Noa Moriel, Matthew Ricci, Guy Pelc, Yair Weiss, Mor Nitzan
Abstract: Characterizing dynamical systems from limited measurements could deepen our understanding of temporal processes in nature. However, the diversity of possible behaviors and the transient variability in systems with equivalent long-term dynamics make this task challenging.
We address this by introducing smooth prototype equivalences (SPE), a framework that fits a diffeomorphism using normalizing flows to distinct prototypes — simplified dynamical systems that define equivalence classes of behavior.
Given sparse, high-dimensional measurements (not necessarily a time-series), SPE can classify the long-term behavior
by comparing the deformation loss of multiple prototype dynamics. Furthermore, our approach enables estimation of the invariant sets of the observed dynamics through the learned mapping from prototype space to data space. Our method outperforms existing techniques in the classification of oscillatory systems and can efficiently identify invariant structures like limit cycles and fixed points in an equation-free manner, even when only a small, noisy subset of the phase space is observed. Finally, we show how our method can be used for the detection of biological processes such as the cell cycle trajectory from high-dimensional single-cell gene expression data.
This code is based on python 3
. The main package requirements in this repository are:
torch>=2.0.1
tqdm
matplotlib
Full requirements can be found in the requirements.txt
file. For easy installation, use the following pip
command:
pip install -r requirements.txt
SPE allows for the characterization of observations from a vector field, the set
This codebase has two main components:
- An implementation of NFs that are expressive but lightweight - the
Diffeo
class fromNFDiffeo.py
- The fitting procedure to the prototypes - the
fit_prototype
function fromfit_SPE.py
Using these, we showed that SPE can be used to estimate limit cycles directly from the vector field data, and also that it is possible to classify the observed data to pre-specified categories of behavior dictated by a set of prototypes.
An example usage of SPE for estimating limit cycles in 2D and higher-dimensional systems can be found in demo.ipynb
. For classification, multiple prototypes need to be fitted. The wrapper function fit_all_prototypes
from fit_SPE.py
is designed to handle this natively.
To use SPE, a prototype has to be defined. In our experiments, we used limit-cycle simple oscillators (SO) as prototypes. These are governed by the following equations (in polar coordinates):
$\dot{r}=r(a-r)^2$ $\dot{\theta}=\omega$
where Callable
objects. The SO prototype can be instantiated using the get_oscillator
function from Hutils.py
.
The notebook create_data.ipynb
allows for the generation of the simulated systems in our experiments. The file systems.py
includes implemented classes for all of the considered simulated systems with more functionalities useful for plotting.
Please be in touch if you have any questions! For contact, you can email Roy Friedman at roy.friedman@mail.huji.ac.il .