Amortized Equation Discovery in Hybrid Dynamical Systems
Abstract
Hybrid dynamical systems are prevalent in science and engineering to express complex systems with continuous and discrete states. To learn laws of systems, all previous methods for equation discovery in hybrid systems follow a two-stage paradigm, i.e. they first group time series into small cluster fragments and then discover equations in each fragment separately through methods in non-hybrid systems. Although effective, these methods do not take fully advantage of the commonalities in the shared dynamics of multiple fragments that are driven by the same equations. Besides, the two-stage paradigm breaks the interdependence between categorizing and representing dynamics that jointly form hybrid systems. In this paper, we reformulate the problem and propose an end-to-end learning framework, i.e. Amortized Equation Discovery (AMORE), to jointly categorize modes and discover equations characterizing the dynamics of each mode by all segments of the mode. Experiments on four hybrid and six non-hybrid systems show that our method outperforms previous methods on equation discovery, segmentation, and forecasting.
1 Introduction
Complex systems in science and engineering often exhibit behaviors and patterns that change over time. Hybrid dynamical systems (Van Der Schaft & Schumacher, 2007) characterize these systems by continuous time series which are interleaved with structural changes producing discrete modes. For instance, consider the motions of antelopes in a herd and how these suddenly change in the presence of lions. Hybrid systems are researched widely with applications in epidemiology (Keeling et al., 2001), legged locomotion (Holmes et al., 2006), robotics (Cortes, 2008), the designs of cyber-physical systems (Sanfelice et al., 2016), and systems with interacting objects (Liu et al., 2023).
A major challenge with hybrid dynamical systems is that one cannot know a priori the number of possible modes and when the switching happens within them. The dynamic modes might alternate from one to another constantly and at any time, due to either internal mechanisms or external influences. When modeling generalized time series as hybrid dynamical systems, it is thus crucial that we categorize the complex dynamics into the most likely discrete modes while characterizing the continuous motion dynamics in between.
Another challenge with characterizing dynamics in hybrid systems, especially physical ones, is that predictive models are often not interpretable. We are often interested in the underlying laws that govern the dynamics, thus preferring analytic models, usually in the form of closed-form ordinary differential equations. Equation discovery from first principles is a challenging problem in all fields of science. To bypass expensive and cumbersome targeted experimentation, researchers have explored using data-driven methods for equation discovery of systems from observations (Langley, 1981; Lemos et al., 2023). They distill parsimonious equations from data and find that compared with black-box neural networks, learned equations can provide insight into the essential dynamics of systems and tend to generalize better (Lutter et al., 2019; Karniadakis et al., 2021).
Equation discovery for hybrid dynamical systems has been a topic of interest for a long time (Vidal et al., 2003; Ozay et al., 2008; Bako, 2011; Ohlsson & Ljung, 2013). Recently, Mangan et al. (2019); Novelli et al. (2022) proposed methods for equation discovery in non-linear hybrid systems. Both methods consist of two stages: they first group time series fragments into a large number of small cluster fragments and then apply an equation discovery method proposed in non-hybrid systems, e.g. SINDy (Brunton et al., 2016), to discover equations in each fragment separately. The separate multi-stage processing limits the potential performance because it does not leverage the commonalities across fragments from the same mode and splits learning into two separate stages, i.e. categorizing and then representing motion dynamics which jointly form hybrid systems.
In this paper, we reformulate the problem of equation discovery in hybrid dynamical systems and propose a one-stage end-to-end learning framework, Amortized Equation Discovery (a.k.a. AMORE), to jointly categorize motion dynamics and discover equations by modeling categorical modes and mode-switching behaviors within systems. Equations are discovered to characterize the dynamics of each mode based on all segments that are assigned to the mode, by learning combinations of candidate basis functions and encouraging parsimony. To model switching behaviors, inspired by REDSDS (Ansari et al., 2021), we infer latent categorical variables, i.e. mode variables, to categorize motion dynamics into discrete modes and learn probabilistic transition behaviors within them. Equations, mode variables, and mode-switching behaviors are jointly learned in the proposed end-to-end learning framework by maximizing the system observation likelihood. We also consider another challenge in previous methods for equation discovery for hybrid systems: they are limited to single-object scenarios where the dynamics of only one object or objects as a whole are considered. We extend our method to multi-object scenarios, AMORE-MIO, where multiple objects interact with each other and change their dynamics accordingly. Extensive experiments on single- and multi-object hybrid systems demonstrate the superior performance of our method on equation discovery, segmentation, and forecasting. The code and datasets are available at https://github.com/yongtuoliu/Amortized-Equation-Discovery-in-Hybrid-Dynamical-Systems.
2 Related Work
Equation discovery in hybrid dynamical systems.
Prior works focus on the simplest hybrid dynamical models, i.e. piece-wise affine systems with linear transition rules (Vidal et al., 2003; Ferrari-Trecate et al., 2003; Roll et al., 2004; Juloski et al., 2005; Paoletti et al., 2007; Ozay et al., 2008; Bako, 2011; Ohlsson & Ljung, 2013). Recently, Mangan et al. (2019); Novelli et al. (2022) relieve these constraints and propose methods for non-linear hybrid systems. Among them, Hybrid-SINDy (Mangan et al., 2019) proposes a two-stage method, i.e. it first uses k-NN to group time series into small cluster fragments and then discovers governing equations separately in each fragment by models proposed in non-hybrid systems, e.g. SINDy (Brunton et al., 2016). Based on Hybrid-SINDy, Novelli et al. (2022) also follows a two-stage paradigm while introducing the number of discontinuities in hybrid systems as a known prior for better performance. Although effective, these two-stage methods learn the mode of each segment individually and do not leverage the commonalities across segments. In this paper, we reformulate the problem and propose an amortized end-to-end learning framework to jointly categorize modes, discover equations, and learn mode-switching behaviors.
Equation discovery in non-hybrid dynamical systems.
Many methods have been proposed for equation discovery in non-hybrid dynamical systems. Bongard & Lipson (2007) and Schmidt & Lipson (2009) leverage genetic programming (Koza et al., 1994) to discover nonlinear differential equations from data. SINDy (Brunton et al., 2016) uses symbolic sparse regression on a library of candidate model terms to select the fewest terms required to describe the observed dynamics. Several methods extend this approach to new settings, e.g. identifying partial differential equations (Rudy et al., 2017), considering additional physical constraints (Loiseau & Brunton, 2018), including control signals (Kaiser et al., 2018), and introducing integral terms for denoising (Schaeffer & McCalla, 2017). These methods cannot be directly applied to hybrid systems because they cannot model an unknown number of modes and unknown mode-switching behaviors.
Switching dynamical systems.
Switching dynamical systems refer to the same systems as hybrid dynamical systems, but highlight different aspects in the literature. Hybrid systems denote systems with a mixture of continuous and discrete states, while switching dynamical systems highlight the switching behaviors of system states. Many methods focus on switching linear dynamical systems where they set matrix calculations to model linear state transitions (Ackerson & Fu, 1970; Ghahramani & Hinton, 2000; Oh et al., 2005). Recently, switching non-linear dynamical systems model state transitions as neural networks, e.g. SNLDS (Dong et al., 2020), REDSDS (Ansari et al., 2021), and GRASS (Liu et al., 2023). While effective in modeling state-switching behaviors, they cannot discover closed-form equations from data. To categorize dynamics, our method is inspired by previous switching dynamical systems (Dong et al., 2020; Ansari et al., 2021; Liu et al., 2023) to infer latent mode variables. Differently, our method can jointly discover parsimonious closed-form equations to characterize dynamics and infer the values of the mode variables.
3 Equation Discovery in Dynamical Systems
In dynamical systems, the dynamics can be expressed by sets of differential equations in the form:
(1) |
Equation discovery in dynamical systems is the task of learning the function from time-series observations where each state . Following SINDy (Brunton et al., 2016), we approximate each dimension for of in Eq. (1) as
(2) |
where is a set of candidate basis functions and is a sparse vector indicating which of these function terms are active in characterizing the dynamics. We encourage the sparsity of based on Occam’s razor principle, where the simplest model is likely the correct one. Ideally, we could encourage this principle by minimizing the norm of the coefficients and solving the following constrained minimization problem
(3) |
where is a hyperparameter representing maximal optimization errors. The regularization penalizes the number of non-zero entries to encourage sparsity. However, optimization under this penalty is computationally intractable due to the non-differentiability and the combinatorial nature of all possible states. Various continuous relaxation methods are proposed in the literature to handle the optimization problems of norm, e.g. , , etc. As our focus in this paper is not to design advanced optimization methods, we utilize the simple and effective norm to optimize Eq. (3).
We implement the coefficients as learnable weights in neural networks. We set the polynomial degree as and use a set of learnable weights to model the coefficients of candidate basis functions. For instance, if the observation is a two-dimensional vector and we set the polynomial degree as 2, the candidate basis polynomial functions are . In this case, and .
4 Equation Discovery in Hybrid Systems
Hybrid dynamical systems produce generalized time series with continuous states and discrete events that need to be modeled, featuring multiple modes that represent different types of dynamics. Instead of learning a single equation for each dimension , as described in Sec. 3, we learn sets of equations for each dimension that represent different modes in hybrid systems. We first introduce how we model mode-switching behaviors and then introduce our whole framework for equation discovery in hybrid systems.
Mode variables.
To model modes and mode-switching behaviors in hybrid systems, inspired by REDSDS (Ansari et al., 2021), we introduce latent categorical variables, i.e. mode variables, to learn categorical distributions of modes and index each set of equations representing each type of dynamics. Specifically, mode variables are discrete variables , where each categorizes the mode at time step .
Count variables.
Besides mode variables, we also model latent count variables to learn the duration distributions of each mode. Count variables can help us avoid frequent mode switching, thanks to the fact that mode durations typically follow a geometric distribution (Ansari et al., 2021). They are modeled as discrete categorical variables , where each state explicitly models the run-length of the currently active mode at time and is the maximal number of steps before a mode switch. Count variables are incremented by 1 when the mode stays the same at the next time step , or they reset to 1 when mode switches to another one .
Mode-specific equation discovery.
Each mode is assigned its own set of candidate basis functions and learnable coefficient weights , which we will use to discover its equation. For instance, at time , the mode variable indexes the candidate basis function and the learnable weights , which together define the equation representing the dynamics of mode . In practice, different modes share the same candidate basis functions, i.e. , unless we have some prior knowledge of the hybrid system. However, the learnable coefficient weights of different modes are individual and never shared, i.e. . We collect all the candidate basis functions in a single vector and similarly we collect all learnable coefficient weights .
Generative model for AMORE.
Assuming Markovian dynamics, the joint generative probability of hybrid systems in our model is described as
(4) |
In the initial states, count variables are ignored as they are always 1 when starting. is the initial distribution over all possible modes. models the initial observation states conditioned on the initial modes. For later time steps , the count transition probability models how the count variables at time change over time depending on their previous values and mode variables at time . The mode transition probability models mode-switching behaviors on how modes switch at time conditioned on the previous mode and observation states at time as well as the updated count state at time . The observation transition probability models how the observations at time are influenced by their previous values at time conditioned on the updated mode variables at time . Equations are amortized and learned at by all segments of each mode to characterize mode dynamics. More specifically, conditioned on motion mode , first indexes a set of candidate basis functions and coefficient weights , which are used together to obtain derivatives of at time . With known time intervals , we finally achieve assuming the dynamics do not change much in short time intervals. For inference of the latent mode and count variables, we conduct exact inference similar to the forward-backward algorithm in HMM (Eddy, 1996). The graphical model for the exact inference is the same as the generative model, which is illustrated in Figure 2. The neural network implementations and details of the inference model are in Appendix A.1 and A.2.
Learnable parameters of AMORE are optimized by maximizing the observation likelihood with sparse regularization on coefficient weights of candidate basis functions
(5) |
The derivatives of the training objective and further expansions over time are detailed in Appendix A.3.
5 Equation Discovery in Multi-object Hybrid Systems
While equation discovery in hybrid dynamical systems has been researched in single-object scenarios, the more general setting of systems with multiple potentially interacting objects is an unexplored yet natural setting. In this section, we elaborate on how our model can be extended for multi-object scenarios, and present AMORtized Equation discovery in MultI-Object hybrid systems, a.k.a. AMORE-MIO. We first introduce how our method models interactions and then introduce the whole framework of AMORE-MIO.
Edge variables.
Assume that objects and motion modes exist in multi-object hybrid systems. Inspired by Kipf et al. (2018); Liu et al. (2023), we model interactions between objects by latent edge variables including self-loop, thus totally for objects. For each pair of objects, interactions model whether object interacts with object at time . The edge variables are modeled in a latent temporal graph , where edges and nodes summarize states of objects. For instance, for defines one graph node summarizing states of object at time which includes observation and latent states . Edge signals interaction relationships between node and node in graph .
Object-shared and mode-specific equation discovery.
We set the number of all possible motion modes as in multi-object hybrid dynamical systems. The motion modes are shared across objects, which are implemented by sets of candidate basis functions and learnable coefficient weights . Each mode has its own and as in Sec. 4. Thus there are K sets of learnable weights for learning dynamics of K modes across N objects. Both the time and space complexity of AMORE-MIO regarding learnable weights of basis functions is . For instance, the mode variable of the object at time indexes and which together form equations to represent the dynamics of mode . Different from single-object scenarios, the mode-switching behaviors of each object are not only influenced by their own evolving nature but also by external influences of potentially interacting objects. We model the influences of interactions on the mode-switching behaviors between objects, which are detailed in the following generative model of AMORE-MIO.
Generative model for amortized equation discovery in multi-object settings.
Assuming Markovian dynamics, the joint generative probability of multi-object hybrid systems in AMORE-MIO is calculated as
(6) |
where the initial states and count transition probability are defined as in Eq. 4 of single-object scenarios but with objects. For later time steps , the edge transition probability models how the edge variables evolve depending on all the states at the previous time step. We model the influences of interactions on the mode transition probability , which characterizes the mode-switching behaviors of multi-object hybrid dynamical systems. Based on the updated modes of each object, the observation transition probability can be factorized over objects where equations of each mode are amortized and learned by all segments from all objects belonging to the same mode. The further expansion over objects of the joint generative probability is in Appendix B.1. For inference of latent mode, count, and edge variables, we conduct posterior approximate inference for edge variables conditioned on observations , and then conduct exact inference of mode and count variables conditioned on observations and the approximate edge variables . The generative and inference models of AMORE-MIO are illustrated in Fig. 3. Learnable parameters of AMORE-MIO are optimized by maximizing the evidence lower bound with sparse regularization on the learnable coefficient weights
(7) |
Neural network implementations, the derivations and the detailed inference model are in Appendix B.2, B.4. and B.3.
6 Experiments
We extensively validate our method on 10 dynamical systems. Specifically, we validate on single-object scenarios using the Mass-spring Hopper dataset, and the Susceptible, Infected and Recovered (SIR) disease dataset from Hybrid-SINDy (Mangan et al., 2019). We validate on multi-object scenarios using the ODE-driven particle dataset and Salsa-dancing dataset from GRASS (Liu et al., 2023). Further, we test the robustness of our methods on non-hybrid systems using datasets of the Coupled linear, Cubic oscillator, Lorenz’ 63, Hopf bifurcation, Seklov glycolysis, and Duffing oscillator from Course & Nair (2023). Detailed settings of the datasets are in Appendix C.1.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.426 | 0.383 | 0.705 | 0.691 |
AMORE (ours) | 0.928 | 0.967 | 0.991 | 0.993 |
Method | NMAE | NRMSE |
---|---|---|
LLMTime | 0.113 / 0.305 | 0.417 / 0.454 |
TimeGPT | 0.092 / 0.217 | 0.322 / 0.340 |
SVI | 0.068 / 0.075 | 0.148 / 0.262 |
Hybrid-SINDy | 0.240 / 0.314 | 0.336 / 0.372 |
AMORE (ours) | 0.008 / 0.039 | 0.026 / 0.059 |
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.296 | 0.283 | 0.538 | 0.519 |
AMORE (ours) | 0.475 | 0.483 | 0.731 | 0.735 |
Method | NMAE | NRMSE |
---|---|---|
LLMTime | 0.352 / 0.396 | 0.481 / 0.523 |
TimeGPT | 0.301 / 0.347 | 0.403 / 0.452 |
SVI | 0.257 / 0.273 | 0.355 / 0.401 |
Hybrid-SINDy | 0.316 / 0.363 | 0.414 / 0.453 |
AMORE (ours) | 0.088 / 0.113 | 0.142 / 0.181 |
Implementation Details.
We train all datasets with a fixed batch size of 40 for 20,000 training steps. We use the Adam optimizer with weight-decay and clip gradients norm to 10. The learning rate is warmed up linearly from to for the first 2,000 steps, and then decays following a cosine manner with a rate of 0.99. Each experiment is running on one Nvidia GeForce RTX 3090 GPU. and of the count variables are simply set as 20 and 50, respectively for all datasets. The number of edge types is set as 2, containing one no-interaction type and one with-interaction type. More details are in Appendix C.2.
Evaluation metrics.
For evaluation of discovered equations, following Course & Nair (2023), we use the reconstruction error between the discovered coefficients of equations and ground truth, i.e. where and are the learned and ground-truth coefficients at time . For evaluation of segmentation, following Ansari et al. (2021), we use frame-wise segmentation accuracy, i.e. Accuracy and after matching the labels using the Hungarian algorithm (Kuhn, 1955), Normalized Mutual Information (NMI) and Adjusted Rand Index (ARI) to measure similarities. For evaluation of forecasting, we use Normalized Mean Absolute Error (NMAE) and Normalized Root Mean Squared Error (NRMSE). We conducted each experiment with 5 random seeds. We report the average score of each experiment in the main paper and put the statistics (error bars) in the appendix due to limited space.
Baselines.
Hybrid-SINDy (Mangan et al., 2019) uses a two-stage paradigm and cannot perform forecasting, thus we compare with it on discovered equations and segmentation. To compare with Hybrid-SINDy on forecasting, we continue the value of the last observable time point as forecasting results of Hybrid-SINDy. For forecasting, we compare with other three recent representative methods, i.e. SVI (Course & Nair, 2023) which is designed for equation discovery in non-hybrid systems and can perform forecasting, LLMTime (Gruver et al., 2023) which utilize pre-trained large language models (LLM) to do forecasting, and TimeGPT (Garza & Mergenthaler-Canseco, 2023) which is the first foundation model for time series. GRASS (Liu et al., 2023) does not discover equations, but models multi-object switching dynamical systems, so it is used for comparison in multi-object systems.
6.1 Single-object Dynamical Systems
6.1.1 Mass-spring Hopper
In the mass-spring hopper system, a mass and spring connect and hop on the ground with two modes, i.e. flight and compression. Details of the dataset are in Appendix C.1.1. Comparison results of time series segmentation on the dataset are in Table 1. We can see that AMORE can achieve significant and consistent performance improvements across all metrics. AMORE categorizes exactly two modes from the system and discovers equations for each mode
which are nearly identical to the ground truth in Eq. (8). In Hybrid-SINDy, equations are discovered in each cluster fragment, thus producing a massive number of equations. To quantitatively compare discovered equations, we compute for Hybrid-SINDy and AMORE which are and , respectively.
Qualitative segmentation results of Hybrid-SINDy and AMORE are shown in Fig. 4. Thanks to the amortized joint learning of modes and equations, AMORE can categorize the exact number of modes, achieve superior segmentation results, and discover high-quality equations. In these experiments, the maximal number of possible modes is set as 3 in our model. After learning, our model chooses 2 modes to be enough to categorize and express the dynamics of the specific hybrid systems. Note that the number of discovered equations in Hybrid-SINDy is the same as the number of time points, which is much larger than the fixed number of modes, e.g. in our model. To visualize discovered modes of Hybrid-SINDy, we aggregate the discovered equations with the same type of function terms as one mode, thus appearing more than 3 modes in the system. Besides, “AMORE w/o count” represents our model without setting count variables. We can see that count variables can help AMORE learn fewer false-positive mode-switching behaviors. More quantitative ablation studies on count variables are in Appendix C.4.3.
We summarize time series forecasting results on the Mass-spring Hopper dataset in Table 2. We can see that our method significantly outperforms SVI which is designed for non-hybrid systems, and LLMTime as well as TimeGPT which utilizes pre-trained large models for forecasting, thanks to the proposed joint learning framework originally designed for hybrid systems.
System | LLMTime | SVI | AMORE (ours) |
---|---|---|---|
Coupled linear | -0.39 | -1.13 | -1.18 |
Cubic oscillator | -0.45 | -1.02 | -1.06 |
Lorenz’63 | -0.41 | -1.27 | -1.23 |
Hopf bifurcation | -0.32 | -0.94 | -1.03 |
Selkov glycolysis | -0.68 | -1.55 | -1.49 |
Duffing oscillator | -0.53 | -1.12 | -1.17 |
6.1.2 SIR Disease Dataset
The Susceptible, Infected and Recovered (SIR) disease model is an epidemiological model used to understand the spread of infectious diseases. Numbers of susceptible, infected, and recovered individuals are involved in model dynamics where some external events describe the modes, e.g. school in session or not. Detailed settings for this dataset are in Appendix C.1.2.
We summarize the segmentation and forecasting results on the dataset in Tables 3 and 4. We can observe similar findings as in the Mass-spring Hopper dataset. AMORE can achieve consistently higher segmentation accuracy and lower forecasting errors across all metrics compared to Hybrid-SINDy, SVI, LLMTime, and TimeGPT. AMORE categorizes exactly two modes from the system and discovers equations for each mode
which are nearly exact to the ground truth in Eq. (9). Quantitative comparisons of the discovered equations are calculated by where Hybrid-SINDy and AMORE are and , respectively. We can see that AMORE can discover high-quality equations, and achieve superior segmentation and forecasting results thanks to the proposed joint learning framework designed for equation discovery in hybrid dynamical systems.
6.1.3 Non-hybrid Dynamical Systems
In some cases, we have prior knowledge of the dynamical systems whether they are hybrid or not. To answer the question of whether our method, which is originally designed for hybrid systems, can still perform well if we know the systems are non-hybrid in advance, we conduct experiments on six non-hybrid physical systems (Course & Nair, 2023), including Coupled linear, Cubic oscillator, Lorenz’63, Hopf bifurcation, Selkov glycolysis, and Duffing oscillator. Detailed settings of the datasets are in Appendix C.1.3. As we have the prior, we set the maximal possible number of modes in AMORE as 1 for all physical systems. Following Course & Nair (2023), we summarize the forecasting results in Table 5. We can see that although our model is not specialized for non-hybrid systems, AMORE can still achieve better forecasting results on 4 out of 6 non-hybrid physical systems, which verifies the robustness of our model to non-hybrid dynamical systems.
6.2 Multi-object Hybrid Dynamical Systems
Equation discovery in multi-object hybrid dynamical systems is an unexplored but more general setting. In this section, we verify the effectiveness of the multi-object variant of our method, i.e. AMORE-MIO, on two multi-object datasets (Liu et al., 2023), i.e. the ODE-driven Particle dataset and the Salsa-dancing dataset.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.205 | 0.192 | 0.414 | 0.407 |
GRASS | 0.445 | 0.437 | 0.732 | 0.726 |
AMORE (ours) | 0.418 | 0.405 | 0.692 | 0.684 |
AMORE-MIO (ours) | 0.453 | 0.442 | 0.741 | 0.735 |
Method | One-step | Multi-step |
---|---|---|
LLMTime | 0.335 / 0.438 | 0.370 / 0.473 |
TimeGPT | 0.351 / 0.445 | 0.392 / 0.490 |
SVI | 0.319 / 0.432 | 0.346 / 0.465 |
Hybrid-SINDy | 0.340 / 0.431 | 0.372 / 0.487 |
GRASS | 0.151 / 0.224 | 0.193 / 0.270 |
AMORE (ours) | 0.184 / 0.265 | 0.217 / 0.302 |
AMORE-MIO (ours) | 0.146 / 0.217 | 0.186 / 0.259 |
6.2.1 ODE-driven Particle Dataset
In ODE-driven particle systems, trajectories of particles are driven by Ordinary Differential Equations where particles switch their driven equations/modes when they collide with each other. Detailed settings of the ODE-driven Particle dataset are in Appendix C.1.4. We summarize the segmentation results on the dataset in Table 6. We can see that our methods including both AMORE and AMORE-MIO achieve better time series segmentation results compared to Hybrid-SINDy and GRASS. Besides, AMORE-MIO can outperform AMORE consistently across all metrics. AMORE-MIO categorizes 4 modes from the system and the discovered equations for each mode are
which share the same number of coefficients and similar values as the ground truth in Eq. (10). of discovered equations by Hybrid-SINDy, AMORE, and AMORE-MIO are , , and , respectively, which shows that as a multi-object extension of AMORE, AMORE-MIO consistently outperforms AMORE and Hybrid-SINDy for equation discovery and mode categorization in multi-object hybrid systems thanks to the specially-designed interaction modeling of AMORE-MIO. We further show the forecasting results in Table 7. We can see that AMORE-MIO consistently achieves the lowest forecasting errors for both one-step and multi-step predictions. Compared with GRASS, AMORE-MIO can obtain better results thanks to the introduced equation priors on the latent motion dynamics.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.102 | 0.097 | 0.325 | 0.309 |
GRASS | 0.173 | 0.177 | 0.579 | 0.526 |
AMORE (ours) | 0.167 | 0.173 | 0.565 | 0.518 |
AMORE-MIO (ours) | 0.179 | 0.182 | 0.583 | 0.531 |
Method | One-step | Multi-step |
---|---|---|
LLMTime | 0.402 / 0.452 | 0.449 / 0.480 |
TimeGPT | 0.341 / 0.417 | 0.394 / 0.446 |
SVI | 0.384 / 0.441 | 0.423 / 0.465 |
Hybrid-SINDy | 0.362 / 0.405 | 0.416 / 0.433 |
GRASS | 0.285 / 0.344 | 0.313 / 0.359 |
AMORE (ours) | 0.291 / 0.361 | 0.334 / 0.373 |
AMORE-MIO (ours) | 0.272 / 0.335 | 0.301 / 0.352 |
Polynomial order | 2 | 3 | 5 | |||
---|---|---|---|---|---|---|
NMI | RER | NMI | RER | NMI | RER | |
Hybrid-SINDy | 0.426 | 0.384 | 0.316 | |||
AMORE (ours) | 0.934 | 0.936 | 0.933 |
Number of modes | 3 | 5 | 10 | |||
---|---|---|---|---|---|---|
NMI | RER | NMI | RER | NMI | RER | |
AMORE (ours) | 0.934 | 0.932 | 0.937 |
6.2.2 Salsa-dancing Dataset
The Salsa-dancing dataset contains four modes, i.e. “moving forward”, “moving backward”, “clockwise turning”, and “counter-clockwise turning”. Details of the dataset are in Appendix C.1.5. We summarize the segmentation and forecasting results on the Salsa-dancing dataset in Table 8 and Table 9. We observe similar findings in this real-world video dataset, as with the ODE-driven particle dataset. AMORE-MIO achieves significantly higher segmentation accuracies compared to Hybrid-SINDy and AMORE. Different from previous datasets, the salsa-dancing system is not generated synthetically by equations while results show that structural learning in the form of equations still benefits forecasting compared to purely autoregressive data-driven methods, i.e. LLMTime, SVI, and GRASS. Qualitative results of the discovered equations on the dancing dataset are in Figure 5.
6.3 Ablation Studies
Sensitivity to order of polynomial functions.
To test the sensitivity of our method to different orders of polynomials as candidate basis functions, we conduct experiments on the Mass-spring Hopper dataset by changing the order of polynomial functions to 2, 3, and 5. We present results in Table 10. We observe that AMORE consistently outperforms Hybrid-SINDy, while AMORE is not sensitive to the polynomial orders compared to Hybrid-SINDy.
Sensitivity to number of dynamic modes
We test the robustness of our method to different maximum numbers of modes, that is 3, 5, and 10, while the true number is 2 on the Mass-spring Hopper dataset. The results of segmentation and discovered equations are in Table 11. We can see that AMORE is impervious to this misspecification, which indicates that we can set a large number of possible modes while AMORE can still learn those needed.
Sensitivity to more complex dynamical systems
We originally followed the setup of Hybrid-SINDy, where all of the dynamics can be approximated by polynomial basis functions. However, our model is not limited to these functions. To show results on more complex dynamical systems, we conduct experiments on a synthetic dataset where two modes are driven by and , respectively. We set the basis functions as polynomials order 3 together with . The discovered equations by our model are
When we set the basis functions as polynomials order 3 without . The discovered equations by our model are and , respectively. We can see that our model can be extended to equation discovery with more complex basis functions. When the candidate basis functions are limited to polynomial functions, our model can discover approximated ones with more terms, complexity, and errors.
Model complexity analysis
The numbers of parameters used in baseline methods are summarized in Table 12. As Hybrid-SINDy is not a deep learning method and does not use neural networks, it does not involve learnable parameters and does not need much data for the training of any little parameters the model has. This comes at the expense that Hybrid-SINDy tends to not generalize beyond simple dynamical settings, as shown in our experiments in the main paper. When given a complex dynamical setting with sufficient data, AMORE and AMORE-MIO perform better and have slightly fewer parameters than the other deep learning-based approaches, except LLMTime.
Method | Number of parameters |
---|---|
Hybrid-SINDy | 0 |
AMORE (ours) | 2,240 |
AMORE-MIO (ours) | 2,512 |
GRASS | 4,628 |
SVI | 2,826 |
LLMTime | 175 billion (GPT-3) |
7 Conclusion and Future work
In this paper, we reformulate the problem of equation discovery in hybrid dynamical systems and propose an end-to-end learning framework, i.e. Amortized Equation Discovery (AMORE) to jointly categorize motion dynamics and discover equations by modeling categorical modes and mode-switching behaviors. Besides, we extend our method to multi-object scenarios, i.e. AMORE-MIO, which is unexplored by previous methods and a more natural setting. Extensive experiments on 10 hybrid and non-hybrid systems demonstrate the effectiveness of our method. Future work can include equation discovery with partial known knowledge, equation discovery from videos of hybrid systems, and more complex candidate basis functions.
Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning and Dynamical Systems. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
Acknowledgements
This work is financially supported by NWO TIMING VI.Vidi.193.129. We also thank SURF for the support in using the National Supercomputer Snellius.
References
- Ackerson & Fu (1970) Ackerson, G. and Fu, K. On state estimation in switching environments. IEEE transactions on automatic control, 15(1):10–17, 1970.
- Ansari et al. (2021) Ansari, A. F., Benidis, K., Kurle, R., Turkmen, A. C., Soh, H., Smola, A. J., Wang, B., and Januschowski, T. Deep explicit duration switching models for time series. Advances in Neural Information Processing Systems, 34:29949–29961, 2021.
- Bako (2011) Bako, L. Identification of switched linear systems via sparse optimization. Automatica, 47(4):668–677, 2011.
- Bongard & Lipson (2007) Bongard, J. and Lipson, H. Automated reverse engineering of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 104(24):9943–9948, 2007.
- Brunton et al. (2016) Brunton, S. L., Proctor, J. L., and Kutz, J. N. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the national academy of sciences, 113(15):3932–3937, 2016.
- Cortes (2008) Cortes, J. Discontinuous dynamical systems. IEEE Control systems magazine, 28(3):36–73, 2008.
- Course & Nair (2023) Course, K. and Nair, P. B. State estimation of a physical system with unknown governing equations. Nature, 622(7982):261–267, 2023.
- Dong et al. (2020) Dong, Z., Seybold, B., Murphy, K., and Bui, H. Collapsed amortized variational inference for switching nonlinear dynamical systems. In International Conference on Machine Learning, pp. 2638–2647. PMLR, 2020.
- Eddy (1996) Eddy, S. R. Hidden markov models. Current opinion in structural biology, 6(3):361–365, 1996.
- Ferrari-Trecate et al. (2003) Ferrari-Trecate, G., Muselli, M., Liberati, D., and Morari, M. A clustering technique for the identification of piecewise affine systems. Automatica, 39(2):205–217, 2003.
- Garza & Mergenthaler-Canseco (2023) Garza, A. and Mergenthaler-Canseco, M. Timegpt-1. arXiv preprint arXiv:2310.03589, 2023.
- Ghahramani & Hinton (2000) Ghahramani, Z. and Hinton, G. E. Variational learning for switching state-space models. Neural computation, 12(4):831–864, 2000.
- Gruver et al. (2023) Gruver, N., Finzi, M., Qiu, S., and Wilson, A. G. Large language models are zero-shot time series forecasters. arXiv preprint arXiv:2310.07820, 2023.
- Holmes et al. (2006) Holmes, P., Full, R. J., Koditschek, D., and Guckenheimer, J. The dynamics of legged locomotion: Models, analyses, and challenges. SIAM review, 48(2):207–304, 2006.
- Juloski et al. (2005) Juloski, A. L., Weiland, S., and Heemels, W. M. H. A bayesian approach to identification of hybrid systems. IEEE Transactions on Automatic Control, 50(10):1520–1533, 2005.
- Kaiser et al. (2018) Kaiser, E., Kutz, J. N., and Brunton, S. L. Sparse identification of nonlinear dynamics for model predictive control in the low-data limit. Proceedings of the Royal Society A, 474(2219):20180335, 2018.
- Karniadakis et al. (2021) Karniadakis, G. E., Kevrekidis, I. G., Lu, L., Perdikaris, P., Wang, S., and Yang, L. Physics-informed machine learning. Nature Reviews Physics, 3(6):422–440, 2021.
- Keeling et al. (2001) Keeling, M. J., Rohani, P., and Grenfell, B. T. Seasonally forced disease dynamics explored as switching between attractors. Physica D: Nonlinear Phenomena, 148(3-4):317–335, 2001.
- Kingma & Welling (2013) Kingma, D. P. and Welling, M. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
- Kipf et al. (2018) Kipf, T., Fetaya, E., Wang, K.-C., Welling, M., and Zemel, R. Neural relational inference for interacting systems. In International conference on machine learning, pp. 2688–2697. PMLR, 2018.
- Koza et al. (1994) Koza, J. R. et al. Genetic programming II, volume 17. MIT press Cambridge, 1994.
- Kuhn (1955) Kuhn, H. W. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955.
- Langley (1981) Langley, P. Data-driven discovery of physical laws. Cognitive Science, 5(1):31–54, 1981.
- Lemos et al. (2023) Lemos, P., Jeffrey, N., Cranmer, M., Ho, S., and Battaglia, P. Rediscovering orbital mechanics with machine learning. Machine Learning: Science and Technology, 4(4):045002, 2023.
- Liu et al. (2023) Liu, Y., Magliacane, S., Kofinas, M., and Gavves, E. Graph switching dynamical systems. arXiv preprint arXiv:2306.00370, 2023.
- Loiseau & Brunton (2018) Loiseau, J.-C. and Brunton, S. L. Constrained sparse galerkin regression. Journal of Fluid Mechanics, 838:42–67, 2018.
- Lutter et al. (2019) Lutter, M., Ritter, C., and Peters, J. Deep lagrangian networks: Using physics as model prior for deep learning. arXiv preprint arXiv:1907.04490, 2019.
- Mangan et al. (2019) Mangan, N. M., Askham, T., Brunton, S. L., Kutz, J. N., and Proctor, J. L. Model selection for hybrid dynamical systems via sparse regression. Proceedings of the Royal Society A, 475(2223):20180534, 2019.
- McMahon et al. (2020) McMahon, A., Robb, N. C., et al. Reinfection with sars-cov-2: Discrete sir (susceptible, infected, recovered) modeling using empirical infection data. JMIR public health and surveillance, 6(4):e21168, 2020.
- Novelli et al. (2022) Novelli, N., Lenci, S., and Belardinelli, P. Boosting the model discovery of hybrid dynamical systems in an informed sparse regression approach. Journal of Computational and Nonlinear Dynamics, 17(5):051007, 2022.
- Oh et al. (2005) Oh, S. M., Ranganathan, A., Rehg, J. M., and Dellaert, F. A variational inference method for switching linear dynamic systems. TR GIT-GVU-05-16, 2005.
- Ohlsson & Ljung (2013) Ohlsson, H. and Ljung, L. Identification of switched linear regression models using sum-of-norms regularization. Automatica, 49(4):1045–1050, 2013.
- Ozay et al. (2008) Ozay, N., Sznaier, M., Lagoa, C., and Camps, O. A sparsification approach to set membership identification of a class of affine hybrid systems. In 2008 47th IEEE Conference on Decision and Control, pp. 123–130. IEEE, 2008.
- Paoletti et al. (2007) Paoletti, S., Juloski, A. L., Ferrari-Trecate, G., and Vidal, R. Identification of hybrid systems a tutorial. European journal of control, 13(2-3):242–260, 2007.
- Roll et al. (2004) Roll, J., Bemporad, A., and Ljung, L. Identification of piecewise affine systems via mixed-integer programming. Automatica, 40(1):37–50, 2004.
- Rudy et al. (2017) Rudy, S. H., Brunton, S. L., Proctor, J. L., and Kutz, J. N. Data-driven discovery of partial differential equations. Science advances, 3(4):e1602614, 2017.
- Sanfelice et al. (2016) Sanfelice, R. G. et al. Analysis and design of cyber-physical systems. a hybrid control systems approach. In Cyber-physical systems: From theory to practice, pp. 1–29. CRC Press Boca Raton, FL, USA, 2016.
- Schaeffer & McCalla (2017) Schaeffer, H. and McCalla, S. G. Sparse model selection via integral terms. Physical Review E, 96(2):023302, 2017.
- Schmidt & Lipson (2009) Schmidt, M. and Lipson, H. Distilling free-form natural laws from experimental data. science, 324(5923):81–85, 2009.
- Toda (2020) Toda, A. A. Susceptible-infected-recovered (sir) dynamics of covid-19 and economic impact. arXiv preprint arXiv:2003.11221, 2020.
- Van Der Schaft & Schumacher (2007) Van Der Schaft, A. J. and Schumacher, H. An introduction to hybrid dynamical systems, volume 251. springer, 2007.
- Vidal et al. (2003) Vidal, R., Soatto, S., Ma, Y., and Sastry, S. An algebraic geometric approach to the identification of a class of linear hybrid systems. In 42nd IEEE International Conference on Decision and Control (IEEE Cat. No. 03CH37475), volume 1, pp. 167–172. IEEE, 2003.
Appendix
Appendix A More Details of AMORE
A.1 Neural Network Implementation
We use neural networks to model the joint generative probabilities of hybrid systems in our model, i.e. Eq. (4). For the initial states, we model the initial prior distributions as:
where and denote categorical and multivariate Gaussian distributions, respectively. We set the prior distribution of as uniform to encourage diversity.
Count variables and count transition probability.
To implement the count variables, we set a categorical distribution over for each mode, where and are the minimal and maximal numbers of time steps before making a mode switch. The count transition probability is modeled as a learnable matrix , which is fixed across all time steps. Each term in represents the probability of the -th mode switching to another mode when its current count is . The probability of a count increment at count for mode can be calculated as
The count transition probability is thus defined as
Mode variables and mode transition probability.
Since the mode variables take one out of possible values, we model them as categorical variables, parameterized by mode transition matrix at timestep . The mode transition probability is modeled as
where we resample the modes or preserve them depending on whether count variables are reset to 1 or not. We model the parameters of the categorical distributions with a neural network, i.e. a simple MLP, that takes as input the observations. The network returns a transition matrix per time step , where rows correspond to past modes and columns current modes . Each term in represents the probability of mode switching to mode at timestep . To satisfy the positivity and constraints , we apply a tempered softmax after , i.e. .
A.2 Inference Model of AMORE
We perform conditionally exact inference for the two discrete latent variables, i.e. modes and counts , similar to the forward-backward procedure for HMM (Eddy, 1996). Conditioned on observations , the posterior joint distribution is calculated by modifying the forward-backward recursions to handle the joint hierarchical latent variables. Specifically, the forward and backward parts are defined as
Specifically, the posterior joint probability of mode and count variables , conditioned on observations is calculated as
The derivatives of the forward section are
where can be expressed by recursively with states transitions.
The derivatives of the backward section are
where can be computed via recursively with states transitions.
A.3 Derivation of Optimization Objective
The optimization objective of our model is to maximize the observation likelihood with sparse regularization on coefficients of candidate basis functions, where the observation likelihood can be calculated as
where is calculated as
Following Markovian property, we expand over time and calculate it as
Finally, combined with expectations, can be calculated as
where , , , , , and are defined as
is the initial discrete mode probability. is the continuous state transition probability conditioned on different types of discrete modes . is the discrete mode transition probability. is the mode duration count transition probability. Besides, and can be calculated similarly to the forward and backward algorithm in HMMs (Eddy, 1996) which is detailed in Appendix A.2.
Appendix B More Details of AMORE-MIO
B.1 Expansion of Generative Model over Objects
The joint generative probability of AMORE-MIO for multi-object hybrid systems is expanded over objects as
where in the initial states, we model for each object an initial mode and observation distributions, i.e. and . For each pair of interactions, models the initial edge distribution. For later time steps , models the edge variable transition probability conditioned on node states in graph . models how the modes of objects are affected by the modes of all other objects, conditioned on count variables , edge variables , and observations . and model for each object an observation transition probability and count variable transition probability.
B.2 Neural Network Implementation
Implementations of , , , and in multi-object scenarios are the same as those in single-object scenarios. Next, we elaborate on how we implement the other terms, i.e. , , and .
Edge variables and edge transition probability.
We implement the edge variable as a categorical distribution over for possible interaction types including a no-interaction type. We set the prior distribution to be higher for no-interaction edges in to encourage sparse graphs. The edge transition probability is modeled as
where The neural network takes , , and as input and outputs the probabilities of all possible edge types at time step , which are further post-processed by a tempered softmax function with temperature to ensure normalization. In practice, the edge transition network is a single hidden layer MLP.
Extension of mode transition probability.
After getting by the edge transition probability, we show how affects the mod-switching behaviors. We model the mode transition probability in multi-object hybrid systems as
where and are a Kronecker function and a tempered softmax function. denotes the probability of each edge type . We set a neural network for each edge type (totally ) to model different interaction effects, which are normalized by to aggregate effects from all the interaction types.
B.3 Inference Model of AMORE-MIO
Approximate inference of edge variables.
We use a graph neural network to conduct approximate inference of edge variables , i.e. . The node embeddings in the latent graph are the observations , and the edge embeddings are calculated by two rounds of message-passing
where is further processed by a tempered Gumbel softmax to achieve , to be more specific . Here, we use continuous relaxation and reparameterization of discrete distributions for gradient backpropagation (Kipf et al., 2018). is a vector sampled from a distribution and the softmax temperature controls relaxation smoothness.
Exact inference of mode and count variables.
Given the approximate edge variables , we do exact inference of the mode and count variables . Similar to the single-object scenarios, the conditional joint distribution is calculated by modifying the forward-backward algorithm. Specifically, the forward and backward are calculated as
Specifically, the joint probability of mode and count variables , conditioned on observations and approximate edge variables is calculated as
The derivatives of the forward section is calculated as:
where are calculated by recursively with states transitions.
The derivatives of the backward section is calculated as
where is computed via recursively by state transitions.
B.4 Derivation of Optimization Objective
Learnable parameters of our model are optimized by maximizing the evidence lower bound (ELBO) with sparse regularization on coefficients of candidate basis functions where the derivatives of ELBO are as follows. For brevity, , , , and represents , , , and respectively. is the number of objects. is the number of time steps.
where is a joint likelihood, and is a conditional entropy for the approximate posterior of edge variable .
B.4.1 Training of ELBO
We use the mini-batch stochastic gradient descent algorithm for training of ELBO. The gradients with respect to or in ELBO are calculated as
where we use the reparameterization trick (Kingma & Welling, 2013) to calculate the gradients of . is an entropy loss. Among the derivative terms, the challenging part is the gradients of joint probability , which is calculated as
Following the Markovian property, we unfold the joint likelihood over time as:
where edge variables evolve based on all previous states of both objects. We model the influences of interactions between each pair of objects by without instantaneous dependences. Combining with expectation, is finally calculated as
where , , , , , , and are defined as
Among these, is the initial joint discrete mode probability. is the observation transition probability conditioned on motion modes . is the discrete edge transition probability. is the discrete motion mode transition probability. is the mode count transition probability. Besides, and are conditional posterior distributions, which can be calculated by the forward-backward algorithm in Appendix B.3.
Appendix C More Experiments
C.1 Details of Datasets
C.1.1 Mass-spring hopper
Figure 6 shows an illustration of a Mass-spring system that contains two motion modes, i.e. flying and compression. A minimal model of the Mass-spring hopper system is defined as
where , , and are the spring constant, mass, and gravity, respectively. is the unstretched spring length, which defines the flying and compression modes. After scaling by , the equations above becomes
Following Hybrid-SINDy (Mangan et al., 2019), we set for data generation. Denoting as and as , thus the target closed-form ordinary differential equations are
(8) |
The generated positions and velocities are concatenated and used as observations. Instead of generating only a few samples in Hybrid-SINDy (Mangan et al., 2019) (3 for training and 5 for validation), we scale up the datasets and sample 240 initial conditions from the ranges and for positions and velocities , respectively. Among them, 200 samples are for training, 20 for validation, and 20 for testing. The system is simulated to generate 150 time steps for each time series, with sampling intervals of . We add Gaussian noise with mean zero and standard derivation to generated samples. By default, we use the first 100 time steps as context and predict the following next 50 time steps one by one based on the ground truth of the previous time step, i.e. one-step prediction. By default, the order of polynomial functions is set as 2, and the maximal number of possible modes is 3.
C.1.2 Susceptible, Infected and Recovered (SIR) Disease Dataset
The SIR disease model in the epidemiological community has been widely studied in the literature (Toda, 2020; McMahon et al., 2020). The model can be defined as
where the rate of transmission is time-varying, which takes two discrete values according to whether the school is in session or not
Following Hybrid-SINDy (Mangan et al., 2019), for dataset generation, the rates that define at which students enter and leave the population are set as and . The total population of students is set as . The recovery rate is set as assuming 5 days is the average infectious period. The base transmission rate is set as and tunes the transmission rate change. Following Hybrid-SINDy (Mangan et al., 2019), the concatenation of and are used as observations. Thus the target closed-form ordinary differential equations are
(9) |
In a school year, the in-class periods are 35-155 and 225-365 days. The break periods are 0-35 and 155-225 days. Instead of creating only one time series for training and one for validation in Hybrid-SINDy, we scale up the datasets and sample 240 initial conditions for , , and . For instance, in each sample, we first sample a from the range , and then sample a from the range , and then calculate by . We simulate each time series for 2 years with a daily interval, thus producing 730 time steps for each time series. We add a random perturbation to the start of each session by changing the states of , and by either -2, -1, 0, 1, or 2, independently. By default, we use the first 600 time steps as context and predict the next 130 time steps one by one based on the ground truth of the previous time step, i.e. one-step prediction. By default, the order of polynomial functions is set as 2, and the maximal number of possible modes is 3 for our methods.
C.1.3 Non-hybrid Physical Systems
Following Course & Nair (2023), non-hybrid physical systems include the Coupled linear, Cubic oscillator, Lorenz’ 63, Hopf bifurcation, Seklov glycolysis, and Duffing oscillator. Equations of a Damped linear oscillator are defined as and . A Damped cubic oscillator is and . A coupled linear system is and . A Duffing oscillator is and . A Selkov glycolysis is and . A Lorenz’63 system is , , and . A Hopf bifurcation is and . We refer readers to see the details in (Course & Nair, 2023). By default, the order of polynomial functions of the Coupled linear, Cubic oscillator, Lorenz’ 63, Hopf bifurcation, Seklov glycolysis, and Duffing oscillator are 2, 3, 2, 3, 3, and 3, respectively for our methods.
C.1.4 ODE-driven Particle Dataset
Following GRASS (Liu et al., 2023), Ordinary Differential Equations are introduced as motion modes to generate trajectories of particles, i.e. Lotka-Volterra, Spiral, and Bouncing Ball
(10) |
Balls are introduced on a squared 2d canvas of size which are with radius and whose locations are randomly initialized. Trajectories of balls are generated by numerical values of different equations over time which are mapped to the canvas field. To simulate mode-switching behaviors, the driven ODE modes of two objects are switched when they collide in the canvas. Different from GRASS (Liu et al., 2023), one mode is regarded as two modes and in this work as they have different explicit equations for equation discovery. In summary, 4,928 samples are for training, 191 samples for validation, and 204 samples for testing. Each trajectory has 150 time steps with 10 frames per second. By default, the order of polynomial functions is set as 3, and the maximal number of possible modes is 5 for our methods.
C.1.5 Salsa-dancing Dataset
Following GRASS (Liu et al., 2023), four modes are annotated and used in the Salsa-dancing dataset, i.e. “moving forward”, “moving backward”, “clockwise turning”, and “counter-clockwise turning”. In summary, 1,321 samples are for training and 156 samples are for testing. Each sample has 100 time steps, among which 80 for context and the remaining 20 for prediction with 5 frames per second. The coordinates of the skeletal joints of dancers in 3D space are as observations. In practice, for all methods, we utilize two representative joints, i.e. right hip and left hip. By default, the order of polynomial functions is set as 3, and the maximal number of possible modes is 5 for our methods.
C.2 More Implementation Details
For each dataset, we set different numbers of modes and orders of polynomial functions for our model. By default, and for the Mass-spring Hopper dataset. and for the SIR dataset. of the Coupled linear, Cubic oscillator, Lorenz’ 63, Hopf bifurcation, Seklov glycolysis, and Duffing oscillator are 2, 3, 2, 3, 3, and 3, respectively. and for the ODE-driven particle dataset. and for the Salsa-dancing dataset.
C.3 Statistics of Experiments
C.3.1 Mass-spring Hopper
Experiments with statistics on the Mass-spring Hopper dataset are reported in Tables 13 and 14, which are extended versions of Tables 1 and 2 in the main paper.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.426 | 0.383 | 0.705 | 0.691 |
AMORE (ours) | 0.9280.011 | 0.9670.013 | 0.9910.005 | 0.9930.007 |
Method | NMAE | NRMSE |
---|---|---|
LLMTime | 0.1130.032 / 0.3050.036 | 0.4170.051 / 0.4540.072 |
SVI | 0.0680.016 / 0.0750.011 | 0.1480.023 / 0.2620.030 |
AMORE (ours) | 0.0080.003 / 0.0390.008 | 0.0260.005 / 0.0590.006 |
C.3.2 SIR disease
Experiments with statistics on the SIR disease dataset are reported in Tables 15 and 16, which are extended versions of Tables 3 and 4 in the main paper.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.296 | 0.283 | 0.538 | 0.519 |
AMORE (ours) | 0.4750.027 | 0.4830.032 | 0.7310.054 | 0.7350.051 |
Method | NMAE | NRMSE |
---|---|---|
LLMTime | 0.3520.073 / 0.3960.091 | 0.4810.084 / 0.5230.096 |
SVI | 0.2570.031 / 0.2730.054 | 0.3550.050 / 0.4010.078 |
AMORE (ours) | 0.0880.012 / 0.1130.018 | 0.1420.029 / 0.1810.035 |
C.4 Additional Ablation Studies
C.4.1 Sampling intervals Analysis
In our experiments, we followed the experimental setup of Hybrid-SINDy on the sampling intervals of the Mass-spring Hopper dataset and the SIR disease dataset. That means we use their standard sampling intervals , e.g. on the Mass-spring Hopper dataset. In Table 17, we report the segmentation comparison results when increases. We double the previous each time and thus get . We can see that when , the segmentation performance of Hybrid-SINDy decreases considerably due to the temporal pattern disruption, while our model has a smaller decrease in performance. When increases (e.g. ), the discretization obviously disrupts the original temporal patterns of time series. Thus, after learning on the discretization, the model shows significantly decreased performance on labels that are annotated based on the original temporal patterns.
Sampling interval | Method | NMI | ARI | Accuracy | |
---|---|---|---|---|---|
0.033 | Hybrid-SINDy | 0.426 | 0.383 | 0.705 | 0.691 |
0.033 | AMORE (ours) | 0.9280.011 | 0.9670.013 | 0.9910.005 | 0.9930.007 |
0.066 | Hybrid-SINDy | 0.422 | 0.385 | 0.701 | 0.697 |
0.066 | AMORE (ours) | 0.9250.017 | 0.9730.014 | 0.9860.007 | 0.9820.010 |
0.132 | Hybrid-SINDy | 0.235 | 0.201 | 0.447 | 0.413 |
0.132 | AMORE (ours) | 0.4580.021 | 0.3690.016 | 0.6270.013 | 0.6440.017 |
0.264 | Hybrid-SINDy | 0.226 | 0.183 | 0.382 | 0.376 |
0.264 | AMORE (ours) | 0.4170.015 | 0.3350.008 | 0.5740.020 | 0.5800.012 |
C.4.2 Number of Training Samples Analysis
To answer the question: “Given the significantly smaller datasets used by Hybrid-SINDy, can the proposed method maintain this level of performance difference?”, we rerun experiments on the Mass-spring Hopper dataset by varying the number of samples in the training set from 3 (the same as Hybrid-SINDy) to 20 and 200. The comparison results are summarized in Tables 18, 19, and 20. In the few-shot setting with a very low number of samples, e.g. 3 samples, Hybrid-SINDy outperforms AMORE. This is expected and a common limitation of deep learning methods, which usually require larger numbers of samples for training. On the other hand, when given more samples, e.g. larger than 20, AMORE outperforms Hybrid-SINDy consistently.
Number of training samples | Method | NMI | ARI | Accuracy | |
---|---|---|---|---|---|
3 | Hybrid-SINDy | 0.425 | 0.377 | 0.693 | 0.684 |
3 | AMORE (ours) | 0.2380.052 | 0.2170.065 | 0.4740.134 | 0.4290.110 |
20 | Hybrid-SINDy | 0.422 | 0.383 | 0.698 | 0.693 |
20 | AMORE (ours) | 0.7740.037 | 0.7620.025 | 0.8460.094 | 0.8530.071 |
200 | Hybrid-SINDy | 0.426 | 0.383 | 0.705 | 0.691 |
200 | AMORE (ours) | 0.9280.011 | 0.9670.013 | 0.9910.005 | 0.9930.007 |
Number of training samples | Method | NMAE | NRMSE |
---|---|---|---|
3 | LLMTime | 0.1130.032 / 0.3050.036 | 0.4170.051 / 0.4540.072 |
3 | SVI | 0.1730.039 / 0.3410.053 | 0.4500.081 / 0.4810.094 |
3 | AMORE (ours) | 0.0910.018 / 0.1600.026 | 0.3150.049 / 0.3480.042 |
20 | LLMTime | 0.1130.032 / 0.3050.036 | 0.4170.051 / 0.4540.072 |
20 | SVI | 0.0940.020 / 0.1470.024 | 0.3020.038 / 0.3810.044 |
20 | AMORE (ours) | 0.0360.012 / 0.0570.018 | 0.1060.025 / 0.1290.031 |
200 | LLMTime | 0.1130.032 / 0.3050.036 | 0.4170.051 / 0.4540.072 |
200 | SVI | 0.0680.016 / 0.0750.011 | 0.1480.023 / 0.2620.030 |
200 | AMORE (ours) | 0.0080.003 / 0.0390.008 | 0.0260.005 / 0.0590.006 |
Number of training samples | Method | RER () |
---|---|---|
3 | Hybrid-SINDy | 8.3 |
3 | AMORE (ours) | |
20 | Hybrid-SINDy | 8.2 |
20 | AMORE (ours) | 5.10.6 |
200 | Hybrid-SINDy | 7.5 |
200 | AMORE (ours) | 2.40.3 |
C.4.3 Count Variables Analysis
The count variables are introduced by REDSDS (Ansari et al., 2021) to learn the duration distributions of each mode from the data and to avoid frequent mode-switching behaviors. We show below some ablations studies on count variables in the Mass-spring Hopper system, where the flying mode usually takes more than twice as many time steps as the compression mode. To quantitatively compare the discovered equations, we first report the equation reconstruction error (RER) for Hybrid-SINDy, AMORE, and AMORE w/o count variable, which are respectively , , and . We can see that with count variables, AMORE has a lower equation reconstruction error than its counterpart without count variables. In Tables 21 and 22, we can see that count variables help AMORE learn fewer false-positive mode-switching behaviors, benefitting segmentation and forecasting.
Method | NMI | ARI | Accuracy | |
---|---|---|---|---|
Hybrid-SINDy | 0.426 | 0.383 | 0.705 | 0.691 |
AMORE (ours) | 0.9280.011 | 0.9670.013 | 0.9910.005 | 0.9930.007 |
AMORE w/o count (ours) | 0.9030.017 | 0.9290.019 | 0.9700.012 | 0.9750.013 |
Method | NMAE | NRMSE |
---|---|---|
LLMTime | 0.1130.032 / 0.3050.036 | 0.4170.051 / 0.4540.072 |
SVI | 0.0680.016 / 0.0750.011 | 0.1480.023 / 0.2620.030 |
AMORE (ours) | 0.0080.003 / 0.0390.008 | 0.0260.005 / 0.0590.006 |
AMORE w/o count (ours) | 0.0140.004 / 0.0460.007 | 0.0520.011 / 0.0680.014 |
C.4.4 Polynomial orders and mode numbers analysis
To qualitatively show the discovered equations when the order of candidates and the number of modes are increased, we increase the order of candidates from 2 to 5, i.e. , and the number of modes from 3 to 5, i.e. on the Mass-spring Hopper dataset. The discovered equations are summarized in Table 23. We can see that our model can categorize exactly 2 modes, i.e. the same as the ground truth, no matter how many potential modes are introduced. Besides, the discovered equations of the 2 modes are regularized by sparsity promotion and do not involve irrelevant function terms thanks to the sparsity regularization when increasing the order of polynomial basis functions.
Settings | Discovered Equations | Ground-truth Equations |
---|---|---|
and | and ; and | and ; and |
and | and ; and | and ; and |