Sparsity in Continuous-Depth Neural Networks
Abstract
Neural Ordinary Differential Equations (NODEs) have proven successful in learning dynamical systems in terms of accurately recovering the observed trajectories.
While different types of sparsity have been proposed to improve robustness, the generalization properties of NODEs for dynamical systems beyond the observed data are underexplored.
We systematically study the influence of weight and feature sparsity on forecasting as well as on identifying the underlying dynamical laws.
Besides assessing existing methods, we propose a regularization technique to sparsify “input-output connections” and extract relevant features during training.
Moreover, we curate real-world datasets consisting of human motion capture and human hematopoiesis single-cell RNA-seq data to realistically analyze different levels of out-of-distribution (OOD) generalization in forecasting and dynamics identification respectively.
Our extensive empirical evaluation on these challenging benchmarks suggests that weight sparsity improves generalization in the presence of noise or irregular sampling.
However, it does not prevent learning spurious feature dependencies in the inferred dynamics, rendering them impractical for predictions under interventions, or for inferring the true underlying dynamics.
Instead, feature sparsity can indeed help with recovering sparse ground-truth dynamics compared to unregularized NODEs.
Introduction
Extreme over-parameterization has shown to be part of the success story of deep neural networks [52, 5, 4].
This has been linked to evidence that over-parameterized models are easier to train, perhaps because they develop “convexity-like” properties that help convergence of gradient descent [10, 14].
However, over-parameterization comes at the cost of additional computational footprint during training and inference [13].
Therefore, motivation for sparse neural networks are manifold and include: (i) imitation of human learning, where neuron activity is typically sparse [2], (ii) computational efficiency (speed up, memory reduction, scalability) [20], (iii) interpretability [51], as well as (iv) avoiding overfitting or improving robustness [6].
Enforcing sparsity in model weights, also called model pruning, and its effects for standard predictive modelling tasks have been extensively studied in the literature [20].
However, sparsity in continuousdepth neural nets for modeling dynamical systems and its effects on generalization properties is still underexplored.
Neural Ordinary Differential Equations (NODEs) [11] have been introduced as the limit of taking the number of layers in residual neural networks to infinity, resulting in continuousdepth (or continuous-time) neural nets.
NODEs were originally predominantly used for predictive tasks such as classification or regression, where they learn some dynamics serving the predictive task.
These networks have also shown great promise for modeling noisy and irregular time-series.
More recently, it has been stated that NODEs can also be thought of as learning the underlying dynamics (i.e., the ODE) that actually govern(s) the evolution of the observed trajectory.
In the prior scenario (predictive performance), a large body of literature has focused on regularizing the number of model evaluations required for a single step of the ODE solver for improving the efficiency [16, 22, 17, 39, 18, 38].
These regularization techniques rely on learning one out of many possible equivalent dynamical systems giving rise to the same ultimate performance, but are easier and faster to solve.
Crucially, these regularizers do not explicitly target sparsity in the model weights or in the features used by the model.
[Figure]
In the latter scenario (inferring dynamical laws), we assume the existence of a ground truth ODE that governs the dynamics of the observed trajectories.
Here, two types of sparsity may be of interest.
First, motivated by standard network pruning, sparsity in model weights ( weight sparsity or model sparsity ) can reduce computational requirements for inference [28], see Figure 1(top).
Second, it has been argued that feature sparsity , i.e., reducing the number of inputs a given output of the NODE relies on, can improve identifiability of the underlying dynamical law [3, 7, 30], see Figure 1(bottom).
The motivation for feature sparsity often relies on an argument from causality, where it is common to assume sparse and modular causal dependencies between variables [45, 54].
In this paper, we empirically assess the impact of various types of sparsity-enforcing methods on the performance of NODEs on different types of OOD generalization for both prediction and for inferring dynamical laws on realworld datasets.
While most existing methods target weight sparsity, we highlight that feature sparsity can improve interpretability and dynamical system inference by proposing a new regularization technique for continuous-time models.
Specifically, our main contributions are the following:
• We propose PathReg 2 , a differentiable L0-based regularizer that enforces sparsity of “input-output paths” and leads to both feature and weight sparsity.
• We extend L0 regularization [31] and LassoNet [26] to NODEs and perform extensive comparisons with existing models including vanilla NODE [11], C-NODE [3], GroupLasso for NODEs [7], and our PathReg.
• We define a useful metric for evaluating feature sparsity, demonstrate the differences between weight and feature sparsity, and explore whether and when one implies the other.
• To cover at least part of the immense diversity of time-series problems, each of which implying different types of OOD challenges, we curate large, real-world datasets consisting of human motion capture ( mocap.cs.cmu.edu ) as well as human hematopoiesis single-cell RNA-seq [32] data for our empirical evaluations.
Background 2.1 Continuous-depth neural nets
Among the plethora of deep learning based methods to estimate dynamical systems from data [29, 44, 27, 38], we focus on Neural Ordinary Differential Equations (NODEs).
In NODEs, a neural network with parameters θ is used to learn the function f θ ≈ f from data, where f defines a (first order)
ODE in its explicit representation ˙ X = f
( X, t ) [11].
Starting from the initial observation X ( a ) at some time t = a , an explicit iterative ODE solver is deployed to predict X ( t ) for t ∈ ( a, b ] using the current derivative estimates from f θ .
The parameters θ are then updated via backpropagation on the mean squared error (MSE) between predictions and observations.
As discussed extensively in the literature, NODEs can outperform traditional ODE parameter inference techniques in terms of reconstruction error, especially for non-linear dynamics
f
In particular, one advantage of NODEs over previous methods for inferring non-linear dynamics such as SINDy [9] is that no dictionary of non-linear basis functions has to be pre-specified.
A variant of NODEs for second order systems called SONODE exploits the common reduction of higher-order ODEs to first order systems [37].
The second required initial condition, the initial velocity ˙ X ( a ) , is simply learned from X ( a ) via another neural network in an end-to-end fashion.
Our experiments build on the public NODE and SONODE implementations.
However, our framework is readily applicable to most other continuous-depth neural nets including Augmented NODE [15], latent NODEs [44], and neural stochastic DEs [27, 48].
2.2 Sparsity and generalization
Two prominent motivations for enforcing sparsity in over-parameterized deep learning models are (a) pruning large networks for efficiency (speed, memory), (b) as a regularizer that can improve interpretability or prevent overfitting.
In both cases, one aims at preserving (as much as possible)
i.i.d.
generalization performance, i.e., performance on unseen data from the same distribution as the training data, compared to a non-sparse model [20].
Another line of research has explored the link between generalizability of neural nets and causal learning [45], where generalization outside the i.i.d.
setting, is conjectured to require an underlying causal model .
Deducing true laws of nature purely from observational data could be considered an instance of inferring a causal model of the world.
Learning the correct causal model enables accurate predictions not only on the observed data (next observation), but also under distribution shifts for example under interventions [45].
A common assumption in causal modeling is that each variable depends on (or is a function of) few other variables [45, 54, 36, 8].
In the ODE context, we interpret the variables (or their derivatives) that enter a specific component
f i as causal parents, such that we can write ˙
X i = f
( pa ( X i ) , t ) [35].
Thus, feature sparsity translates to each variable X
i having only few parents pa ( X i ) , which can also be interpreted as asking for “simple” dynamics.
Since weight sparsity as well as regularizing the number of function evaluations in NODEs can also be considered to bias them towards “simpler dynamics”, these notions are not strictly disjoint, raising the question whether one implies the other.
In terms of feature sparsity, Aliee et al.
[3], Bellot et al.
[7] study system identification and causal structure inference from time-series data using NODEs.
They suggest that enforcing sparsity in the number of causal interactions improves parameter estimation as well as predictions under interventions.
Let us write out f θ as a fully connected net with L hidden layers parameterized by θ :=
( W l , b l ) L +1 l =1 as
[Equation]
with element-wise activation function σ , l -th layer weights W l , and biases b l .
Aliee et al.
[3] then seek to reduce the overall number of parents of all variables by attempting to cancel all contributions of a given input on a given output node through the neural net.
In a linear setting, where σ ( x ) = x , the regularization term is defined by
[Equation]
where A ij = 0 if and only if the i -th output is constant in the j -th input.
In the non-linear setting, for certain σ ( x ) ̸ = x , the regularizer ∥
A ∥ 1 , 1 = ∥| W L +1 | · · · | W 1 |∥ 1 , 1 (with entry wise absolute values on all W l ) is an upper bound on the number of input-output dependencies, i.e., for each output i summing up all the inputs j it is not constant in.
Regularizing input gradients [42, 41, 43] is another alternative to train neural networks that depend on fewer inputs, however it is not scalable to high-dimensional regression tasks.
Bellot et al.
[7] instead train a separate neural net f
θ i : R n → R for each variable X
i and penalize
NODEs using GroupLasso on the inputs via
[Equation]
where W 1 i is the weight matrix in the input layer of f i and [ W 1 i ] · ,k refers to the k th column of
W 1 i that should simultaneously (as a group) be set to zero or not.
While enforcing strict feature sparsity (instead of regularizing an upper bound), parallel training of multiple NODE networks can be computationally expensive (Figure 1, bottom).
While this work suggests that sparsity of causal interactions helps system identification, its empirical evaluation predominantly focuses on synthetic data settings, leaving performance on real data underexplored.
Another recent work suggests that standard weight or neuron pruning improves generalization for
NODEs [28].
The authors show that pruning lowers empirical risk in density estimation tasks and decreases Hessian’s eigenvalues, thus obtaining better generalization (flat minima).
However, the effect of sparsity on identifying the underlying dynamics as well as the generalization properties of
NODEs to forecast future values are not assessed.
Sparsification of neural ODEs
In an attempt to combine the strengths of both weight and feature sparsity, we propose a new regularization technique, called PathReg, which compares favorably to both C-NODE [3] and
GroupLasso [7].
Before introducing PathReg, we describe how to extend existing methods to NODEs for an exhaustive empirical evaluation.
3.1 Methods
L0 regularization.
Inspired by [31], we use a differentiable L0 norm regularization method that can be incorporated in the objective function and optimized via stochastic gradient descent.
The L regularizer prunes the network during training by encouraging weights to get exactly zero using a set of non-negative stochastic gates z .
For an efficient gradient-based optimization, Louizos et al.
[31] propose to use a continuous random variable s with distribution q ( s ) and parameters ϕ , where z is then given by
[Equation]
Gate z is a hard-sigmoid rectification of s 2 that allows the gate to be exactly zero.
While we have the freedom to choose any smoothing distribution q ( s ) , we use binary concrete distribution [33, 21] as suggested by the original work [31].
The regularization term is then defined as the probability of s being positive
[Equation]
where Q is the cumulative distribution function of s .
Minimizing the regularizer pushes many gates to be zero, which implies weight sparsity as these gates are multiplied with model weights.
L regularization can be added directly to the NODE network f θ .
LassoNet is a feature selection method [26] that uses an input-to-output skip (residual) connection that allows a feature to participate in a hidden unit only if its skip connection is active.
LassoNet can be thought of as a residual feed-forward neural net Y = S T X
+ h θ ( X ) , where h θ denotes another feed-forward network with parameters θ , S ∈ R n × n refers to the weights in the residual layer, and Y are the responses.
To enforce feature sparsity, L1 regularization is applied to the weights of the skip connection, defined as ||S|| 1 , 1 (where ∥ · ∥ 1 , 1 denotes the element-wise L1 norm).
A constraint term with factor ρ is then added to the objective to budget the non-linearity involved for feature k relative to the importance of X k
[Equation]
subject
[Equation]
where [ W 1 ] · ,k denotes the k th column of the first layer weights of h θ , and [ S ] · ,k represents the k th column of S .
When ρ = 0 , only the skip connection remains (standard linear Lasso), while ρ → ∞ corresponds to unregularized network training.
LassoNet regularization can be extended to NODEs by adding the skip connection either before or after the integration (the ODE solver).
If added before the integration, which we call Inner LassoNet, a linear function of X is added to its time derivative
[Equation]
Adding the skip connection after the integration (and the predictor o ), called Outer LassoNet, yields
[Equation]
PathReg (ours).
While L0 regularization minimizes the number of non-zero weights in a network, it does not necessarily lead to feature sparsity meaning that the response variables can still depend on all features including spurious ones.
To constrain the number of input-output paths , i.e., to enforce feature-sparsity, we regularize the probability of any path throughout the entire network contributing to an output.
To this end, we use non-negative stochastic gates z
= g ( s ) similar to Eq.
4, where the probability of an input-output path P being non-zero is given by
[Equation]
and we constrain
[Equation]
to minimize the number of paths that yield non-zero contributions from inputs to outputs.
This is equivalent to regularizing the gate adjacency matrix A z =
G L +1 · . . .
· G 1 .
Where G l is a probability matrix corresponding to the probability of the l -th layer gates being positive.
Then, A z ij represents the sum of the probabilities of all paths between the i -th input and the j -th output.
Ultimately, we thus obtain our PathReg regularization term
[Equation]
G
[Equation]
=
[Equation]
ij ̸
[Equation] [Equation]
where q l ( z ij ̸ = 0) with parameters ϕ i,j is the probability of the l -th layer gate z ij being nonzero.
Regularizing ∥
A z ∥ 1 , 1 , minimizes the number of paths between inputs and outputs and induces no shrinkage on the actual values of the weights.
Therefore, we can utilize other regularizers on θ such as ∥ A ∥ 1 , 1 in conjunction with PathReg similar to Eq. 2.
In this work, we consider the following overall loss function
[Equation]
12) where L corresponds to the loss function of the original predictive task, L E the overall predictive loss, o is the NODE-based model with f modeling time derivatives, g ( · ) :
= min(1 , max(0 , · )) , λ 0 , λ 1 ≥are regularization parameters, and ⊙ is entry-wise multiplication.
L E measures how well the model
[Table]
fits the current dataset.
While ∥ A ∥ 1 , 1 shrinks the actual values of weights θ in an attempt to zero out entire paths, ∥
A z ∥ 1 , 1 enforces exact zeros for entire paths at once.
When A z ij = 0 the output i is constant in input j .
In practice, during training the expectation in Eq.
12 is estimated as usual via
Monte Carlo sampling.
Unlike GroupLasso [7], PathReg does not require training of multiple networks in parallel.
Moreover, unlike C-NODE [3], PathReg leads to exact zeros in the weight matrices and requires no choice of threshold for deciding which paths are considered as zeros (see Figure 2).
3.2 Training sparse models
Sparsity can generally be enforced during or after model training.
In this paper, we study two main approaches [20] to train sparse models: (i) sparse training , where we add regularizers already during model training; (II) training and iterative sparsification , where we iteratively increase regularization parameters only after the model has been trained (close to) to convergence.
A detailed description of our training procedures and architecture choices for each experiment is provided in Appendix A.
3.3 Assessing feature sparsity
For models regularized with L0 or PathReg the natural measure for feature sparsity is ( |
[Equation]
(13) where absolute values are taken entry-wise.
LassoNet also allows for a natural feature sparsity metric by counting the non-zero input weights (cid:80) nj =1 ∥ W (1) j ∥ 2 > ϵ of the first hidden layer, where n denotes the number of input features and ϵ is a small tolerance parameter.
To evaluate feature sparsity for other feed-forward continuous-depth models, we count the number of non-zero elements in A = | W L +1 | · · · | W 1 | again with entry wise absolute values on all W and within some tolerance ϵ (set to 1 e − 5 in our experiments).
This amounts to an upper bound on the number of input-output dependencies: while we can have A i,j ̸ = 0 even though X j / ∈ pa f θ ( X i ) , A i,j = 0 always implies
X j / ∈ pa f θ ( X i ) .
Results
In this section, we present empirical results on several datasets from different domains including human motion capture data and large-scale single-cell RNA-seq data.
We demonstrate the effect of the different sparsity methods including L0 [31], C-NODE [3], LassoNet [26], GroupLasso [7], and our PathReg on the generalization capability of continuous-depth neural nets.
We address different aspects of generalization by assessing the accuracy of these models for time-series forecasting and the identification of the governing dynamical laws.
In all examples, we assume that the observed motion can be (approximately) described by a system of ODEs where variables correspond directly to the observables of the trajectories.
4.1 Sparsity for system identification
We motivate sparsity for NODEs starting with a simple second-order NODE as used by Aliee et al.
The differential equations explaining this system are presented in Appendix B.1.
The questions
BaseL
Model
C-NODE Model
PathReg Model + Feature
LassoNet Feature
Method
N a m e
R e g u l a r
i z a t
i o n a pp li e d o n
Overall
Performance
Sparsities
O v e r a ll S c
o
r e
O v e r a ll
P e
r
f
o r m a n ce
Worst
Best 8.5e-3 2.0ePerformance (MSE)
Ranking
Best
Worst
T r a i n W a l k
T r a i n G o l f
T r a i n W a v e
T e s t G o l f
O v e r a ll
S p a r s i t i e s
W e i g h t
F ea t u r e T e
s t W a l k
Min
Max 0.
Sparsity (%) that we try to answer here are whether different sparsity methods can (i) learn the true underlying system, and (ii) forecast into the future (extrapolate).
For this linear system, the adjacency matrix represents the exact coefficients in Eq.
The results summarized in Tables 1 and 2 show that
PathReg, C-NODE, LassoNet, and GroupLasso perform well with respect to reconstruction error.
Moreover, PathReg, C-NODE, and GroupLasso lead to higher sparsity and outperform other methods for extrapolation.
Among these methods, only PathReg and C-NODE are able to learn the true system with the lowest error 4 .
4.2 Sparsity improves time-series forecasting
We next demonstrate the robustness of sparse models for both reconstructing and extrapolating human movements using real motion capture data from mocap.cs.cmu.edu .
Each datapoint is 93-dimensional (31 joint locations with three dimensions each) captured over time.
We select three different movements including walking, waving, and golfing, and use 100 frames each for training.
After training, we query all models to extrapolate the next 100 frames.
For walking and golfing, where multiple trials are available, we also test the model on unseen data in the sense that it has not seen any subset of those specific sequences (despite having trained on other sequences depicting the same type of movement).
[Figure]
Generally, for time-series forecasting, it is not straight forward to give precise definitions of in-, and out-of-distribution.
In Table 7 in Appendix C, we show a grid of plots illustrating loss and sparsity as a function of the regularization parameter λ of each method on this dataset.
We show detailed results in Tablein Appendix C and summarize them concisely in Figure 3.
We did not manage to scale GroupLasso to this 93-dimensional dataset.
While all other models show comparative performance (in terms of MSE error), only PathReg achieves strong levels of both weight and feature sparsity (quantitative comparison is in Table 3).
The results show that PathReg outperforms other meth-
[Figure]
P a t h R e g ods with respect to MSE for both train and test datasets while resulting in the highest model and feature sparsity.
We further examine the extrapolation (in time) capability of these models.
We observe that all sparsity regularization techniques improve extrapolation over unregularized NODEs.
Figure 4 qualitatively illustrates the reconstruction and extrapolation performance of both the baseline and PathReg for the walking dataset (visually, the results are similar to PathReg for other regularizers).
While these models perform well for extrapolation and generalization to unseen data, we show that only PathReg and C-NODE are able to avoid using spurious features for forecasting.
Figures 7 and 8 in Appendix C show that PathReg and C-NODE learn sensible and arguably correct adjacency matrices (derived from joint connectedness), whereas L0 and LassoNet fail to sparsify the input-output interactions appropriately (more details in Appendix C.2).
Since we use second-order NODEs for this dataset, the adjacency matrix described in Section 3.3 represents how the acceleration predicted by f θ of each joint point (e.g., X i ) depends on the positions as well as the velocities of other joint points (e.g., X j ).
In case the dependency is non-constant, we infer that the joint point X i interacts with X j .
4.3 Sparsity improves dynamic identification for single-cell data
Finally, we explore how pruning (i) improves real-world generalization and (ii) helps to learn genegene interactions in human hematopoiesis single-cell multiomics data [32] (GEO accession code =
GSE194122).
The regulatory (or causal) dependencies between genes can explain cellular functions and help understanding biological mechanisms [1].
Gene interactions are often represented as a gene regulatory network (GRN) where nodes correspond to genes and directed edges indicate regulatory interactions between genes.
Reliable GRN inference from observational data is exceptionally challenging and still an open problem in genomics [40].
As human regulatory genes known as transcription factors ( ∼ 1,600 [25]), do not individually target all genes (potentially up to ∼ 20,000), the inferred GRN is expected to be sparse .
Thus, predicting the expression of a gene should depend on few other genes that can be restricted using sparsity-enforcing regularizers.
BaseL
Model
C
[Figure]
PathReg Model
[Figure]
Feature
LassoNet Feature
Method
N a m e
R e g u l a r
i z a t
i o n a pp li e d o n
Overall
Performance
Sparsities
O v e r a ll S c
o
r e
O v e r a ll
P e
r
f
o r m a n ce
Worst
Best 1.
Performance (MSE)
Ranking
Best
Worst
S 1 D S 1 D
S 2 D
S 3 D
O v e r a ll
S p a r s i t i e s
W e i g h t
F ea t u r e
S p u r i o u s F ea t u r e s S 2 D
Min
Max 0.
Sparsity (%)
For assessing real-world generalization of various sparsity-enforcing methods, we use human bone marrow data of four diverse donors, generated at three different sites using five sequencing batches (the pre-processing steps applied to the data are discussed in Appendix B.3).
In this experiment, we train NODE models with one batch (S1D2), and later test those using other four batches (S1D1, S2D1,
S2D4, and S3D6).
Notably, time-resolved ground truth dynamics of cells throughout their lifetime are not available, because all existing genome-wide technologies are destructive to the cells [32].
Therefore, scRNA-seq only offers static snapshots of data and the temporal order of cell states is commonly estimated based on certain distances between their measured transcriptomes.
Following that, we first apply the diffusion pseudo-time (DPT) ordering approach [19], a diffusion map based manifold learning technique, to rank the cells.
This allows to generate a cell fate mapping from hematopoietic stem cells (HSC) into three biological lineages that are used for training: Monocyte,
Erythroid, and B cells (Figure 5).
NODEs are then trained using highly-variable genes (529 genes) with time taken to be the inferred pseudo-time (Figure 9).
The train and test MSE across 5 batches and three pruning methods are presented in Table 5 and
Table 7 in Appendix C.3 and summarized in Figure 6.
While all regularized models achieve decent predictive performance, PathReg outperforms the other methods in most scenarios.
We further study the transcription-factor-to-target-gene interactions via the adjacency matrices filtered for transcription factors (columns) and target genes (rows) (see Appendix B.3 for more details).
The adjacency matrix A demonstrates what transcription factors (on columns) are used for predicting the expression value of a target gene (on rows).
| A ij | > ϵ for a small threshold ϵ = 1 e − 5 can then be interpreted as an interaction between gene i and gene j being present in the data (see Figure 10 for an illustrating example).
For visualisation purposes, Figure 11 only shows the adjacency matrices across the Erythroid lineage.
However, the results are comparable for other lineages.
The used list of transcription factors and target genes are extracted using chromatin and sequence-specific motif information (we again refer to Appendix B.3 for more details).
Since ground truth dynamics are not known for GRNs, validating the inferred interactions for multiple cell types is a challenging task.
However, we observe that PathReg and L0 are able to remove the interactions between pairs known to not directly causally influence each other, including target genes (called spurious features in Tableand further discussed in Appendix B.3), while the other models fail in that regard.
Assessed by the literature, we also observe that known Erythroid transcription factors are inferred as important by both PathReg and L0 (RUNX1 [24], ETV6 [49], NFIA [34], MAZ [12], GATA1 [53]).
Conclusion and discussion
We have shown the efficacy of various sparsity enforcing techniques on generalization of continuousdepth NODEs and proposed PathReg
, a regularizer acting directly on entire paths throughout a neural network and achieving exact zeros.
We curate real-world datasets from different domains consisting of human motion capture and single-cell RNA-seq data.
Our findings demonstrate that sparsity improves out-of-distribution generalization (for the types of OOD considered) of NODEs when our objective is system identification from observational data, extrapolation of a trajectory, or real-world generalization to unseen biological datasets collected from diverse donors.
Finally, we show that unlike weight sparsity, feature sparsity as enforced by PathReg can indeed help in identifying the underlying dynamical laws instead of merely achieving strong in-distribution predictive performance.
This is particularly relevant for applications like gene-regulatory network inference, where the ultimate goal is not prediction and forecasting, but revealing the true underlying regulatory interactions between genes of interest.
We hope that our empirical findings as well as curated datasets can serve as useful benchmarks to a broader community and expect that extensions of our framework to incorporate both observational and experimental data will further improve practical system identification for ODEs.
Finally, our path-based regularization technique may be of interest to other communities that aim at enforcing various types of shape constraints or allowed dependencies into deep learning based models 5 .
Acknowledgments and Disclosure of Funding
We thank Ronan Le Gleut from the Core Facility Statistical Consulting at Helmholtz Munich for the statistical support.
HA and FJT acknowledge support by the BMBF (grant 01IS18036B) and
the
Helmholtz Association’s Initiative and Networking Fund through Helmholtz AI (grant ZT-I-PF-5-01) and CausalCellDynamics (grant Interlabs-0029).
TR is supported by the Helmholtz Association under the joint research school "Munich School for Data Science" - MUDS.
NK was funded by Helmholtz
Association’s Initiative and Networking Fund through Helmholtz AI.
FJT reports receiving consulting fees from Roche Diagnostics GmbH and ImmunAI, and ownership interest in Cellarity, Inc. and
Dermagnostix.
The remaining authors declare no competing interests.
A Models
All neural networks used in this work are fully connected, feed-forward neural networks.
First-order
NODEs are used for single-cell data, while second NODEs are used for the synthetic example as well as the motion capture data.
In the second-order NODEs, the initial velocities are predicted using a neural network with two hidden layers with 20 or 100 neurons depending on the dataset with ELU activation function.
The main architecture to infer velocities (or accelerations) also contains two hidden layers of sizes 20 or 100 depending on the size of the input and ELU activation function.
As an ODE solver, we use an explicit 5 -th order Dormand-Prince solver commonly denoted by dopri5 .
All models are optimized using Adam [23] with an initial learning rate of 0 .
We use PyTorch’s default weight initialization scheme for the weights.
All models can be trained entirely on CPUs on consumer grade Laptop machines within minutes or hours.
Execution times per epoch for the single-cell data with 529 features are as follows: Base=0.9, L0 = 1.3, L1 = 0.95, PathReg = 1.05,
GroupLasso =
(not scalable), LassoNet = 0.83 seconds.
Except LassoNet that iteratively increases the sparsity regularization parameter, we observe that the rest of the studied methods perform better when the regularization term is fixed during the training (sparse training).
B Datasets B.1 Synthetic second-order ODE
We use a second-order, homogeneous, linear system of ODEs with constant coefficients to assess how pruning affects system identification using NODEs.
Our system is denoted as:
[Equation] [Equation]
[Equation]
We also set X (0) =
8) and ˙ X (0) =
as initial positions and velocities, respectively
B.2 Motion capture data
The Carnegie Mellon University Motion Capture Database [46] is a large collection of human motion data.
We are only interested in those records where activities are performed by a single person who does not interact with other people and has minimal contact with objects within the environment.
The data is presented as 31 joint points in 3D space (in total of 93 variables) and a graph links them.
The data is preprocessed as the following:
• Centering the frames: The root point is fixed at the origin (0 , 0 , 0) for the whole duration of the movement.
We observe that this method is effective particularly for walking data.
• Centering the first frame: For golfing and waving, the root point of the first frame is moved to the origin (0 , 0 , 0) .
• Setting the floor at z = 0 : We find the minimum value of the Z-coordinate throughout the trial and among all joint points.
We consider this level to be the “floor” and move all points so that the minimum value of z during the whole trial is at 0 on the Z-axis.
B.3 Single-Cell RNA-seq
The single-cell RNA count data is first normalized for library size to remove any difference that is arisen due to sampling effects.
Gene counts across lineages are then scaled to improve comparisons between genes by weighting them equally.
While we expect batch correction to help our method in that it should be easier to predict dynamics for unseen batches, we intentionally avoided that, interpreting each batch as some form of OOD experiment to study the generalization of the methods.
To map putative transcription factor (TF) and target gene relationships, we use as a reference a regulatory network generated using the gene expression and chromatin accessibility features available in the human immune cells dataset.
Briefly, using the function rank_genes_groups from
SCANPY [50], we select the top 1,000 genes and 25,000 chromatin peaks, using cell type label as a covariate.
Then, for each chromatin peak we map sequence-specific TF motifs using as reference the
TF archetypes from ENCODE (n=236), Peaks are mapped to the closest gene using the R package
ChIPseeker, with default parameters for the genome build hg38 [47].
All chromatin peaks linked to a gene as an enhancer annotation are considered, as long as the mapped distance between peak and promoter is below 200 Kbp.
Promoter/intron/exon peaks are always mapped to the harboring gene.
Our rule for successfully mapping a TF to a target gene through a chromatin peak is that all
TF, chromatin peak, and target gene, have to be simultaneously in the list of features selected in the rank_genes_groups function for cell type of interest, and there have to be TF motifs linked to that transcription factor in the chromatin peak.
This gives us a total of 113 TFs and 365 potential targets genes across all cell types, that we use for evaluating the models.
These curated relationships between TFs and target gene are preliminarily useful for assessing if our model captures associations that can have some level of biological support.
That means, if f indicates a dependency between a TF and a target gene, being also recovered in this list, we can suggest that this relationship is supported by the existence of a TF-peak-gene association.
We also define the interactions between target genes not linked to TFs through peaks as spurious , given their lack of biological support for direct gene regulation.
Of course, we emphasize that our choice of "spurious" might not certainly capture all types of spurious associations.
Curating a list of cell-type specific TFs might offer additional, context-specific support, but only for a handful of TFs.
C Extended results C.1 Synthetic second-order ODE
Table 2 shows the inferred adjacency matrices, reconstructed and extrapolated samples.
The values in the adjacency matrices show the coefficients of the learned differential equations with the true coefficients presented in Eq.
14, 15,and 16.
Only C-NODE and PathReg are able to learn the true dynamics.
C.2 Motion capture data
Tables 3 and 4 show train and test MSE as well as model and feature sparsity for motion capture data.
The inferred adjacency matrix for walking motion using PathReg is illustrated in Figure 7.
The joint points corresponding to each leg or hand are highlighted with dashed lines.
The extended results across different methods and motions are also presented in Figure 8.
We observe that only PathReg and C-NODE are able to learn the important interactions.
For example, when waving with the left hand, PathReg correctly identifies only interactions between the joint points corresponding to the left arm.
For the golfing movement, PathReg correctly recovers that both arms move in a connected fashion, but legs and most other body parts are not substantially involved in the movement.
However, the base model with no regularizer and L0 fail to sparsify the interactions.
While LassoNet can sparsify the interactions, we do not observe a meaningful association with the important joint points.
C.3 Single-cell data
Tables 5 and 6 compare MSE and sparsity of various models.
Figure 9 presents the real and predicted expression of genes over time for three lineages including Monocyte, Erythroid, and B using PathReg.
The inferred adjacency matrices are also illustrated in Figure 11.
C.4 Analysis of the effect of regularization on sparsity and performance
The plots in Table 7 show the effects that different regularization weights have on performance and model as well as feature sparsity.
[Table]
ECONSTRUCTION
E XTRAPOLATION
[Table]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure] [Table] [Figure] [Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure]
[Table] [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Table]
[Figure]
f t l e g r
i g h t l e
[Figure] [Figure]
[Table]
r e a l e x p r e ss i o n s t i m e genes p r e d i c t e d e x p r e ss i o n s
M o n o c
y t e li n e a g e r e a l e x p r e ss i o n s p
r e d i c t e
d e x p r e ss
i o n s
E r y t h r
o i
d li n e a g e r e a l e x p r e ss i o n s p
r e d i c t e
d e x p r e ss
i o n s
B li n e a g e
[Figure] [Figure]
[Table] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table] [Table]
[Table]