Learning Dynamics and Structure of Complex Systems Using Graph Neural Networks
Abstract
Many complex systems are composed of interacting parts, and the underlying laws are usually simple and universal.
While graph neural networks provide a useful relational inductive bias for modeling such systems, generalization to new system instances of the same type is less studied.
In this work we trained graph neural networks to fit time series from an example nonlinear dynamical system, the belief propagation algorithm.
We found simple interpretations of the learned representation and model components, and they are consistent with core properties of the probabilistic inference algorithm.
We successfully identified a ‘graph translator’ between the statistical attributes in belief propagation and parameters of the corresponding trained network, and showed that it enables two types of novel generalization: to recover the underlying structure of a new system instance based solely on time series observations, and to construct a new network from this structure directly.
Our results demonstrated a path towards understanding both dynamics and structure of a complex system and how such understanding can be used for generalization.
Introduction
Many real world problems involve dynamical systems composed of interacting parts, such as planet movement, social networks, protein folding, neural circuits, electrical grids etc.
While a system can show complex and rich behavior, the elementary rules about the interaction are usually much simpler.
The ability to abstract these simple rules from complex dynamics is one hallmark of intelligence as it is a key feature of understanding.
When modeling such a dynamical system, we can usually exploit the underlying symmetry and impose certain canonical assumptions on the model.
Graph neural networks (GNN) explicitly model each part of the system and use local messages to model the interaction among them (Scarselli et al., 2009;
Li et al., 2016; Battaglia et al., 2018;
Ying et al., 2018).
While GNN framework has been used to study a variety of dynamical systems (Gilmer et al., 2017; Watters et al., 2017; Kipf et al., 2018), commonly it is used for modeling one specific instance of the system (Battaglia et al., 2016; Bapst et al., 2020).
As a result it is not trivial to disentangle the different aspects of the learned system, and interpret components of the trained model (Cranmer et al., 2020).
In this study, we propose to model multiple instances of the same type of system, and explicitly learn the universal dynamics which are shared across all instances, as well as the specific structure of each individual one.
We analyze to disentangle these two aspects of the learned GNN models and show how this understanding enables generalization to new problem instances.
We choose the belief propagation (BP) algorithm on probabilistic graphical model (PGM) as the dynamical system of interest.
BP performs probabilistic inference on a set of random variables and their statistical interactions via iterative computations.
The algorithm itself is an important operation as it marginalizes out nuisance variables efficiently (approximately for loopy graphs), which is useful in many situations.
Given the time series of BP outputs, we aim to understand how they change over time (dynamics) and to recover the underlying PGM (structure).
In this report, we begin by introducing the mathematical definition of GNNs used in our work.
We next show the results of fitting GNN models to the BP outputs on time-varying multivariate Gaussian distributions, and analyze the representation and components of trained models.
We then develop ‘graph translator’ that links between the structural parameters of GNN models and static properties of
Gaussian distributions, and show how it enables two types of generalization to new PGM instances.
Lastly, we discuss the limitations and future directions of our approach.
Background 2.1 Graph neural network
A graph neural network (Scarselli et al., 2009; Li et al., 2016; Battaglia et al., 2018) is a messagepassing algorithm defined over a graph G =
( V , E ) with vertices V and edges E .
For a graph of size
N , V = { 1 , . . .
, N } and E ⊆ { ( i, j ) |
( i, j ) ∈
V 2 ∧ i ̸
= j } where ( i, j ) represents a directed edge from vertex j to i .
Each vertex i is associated with a vertex parameter v i , and each edge ( i, j ) is associated with an edge parameter e ij .
We assume that all vertex parameters v i are of the same dimension D v , and all edge parameters e ij are of dimension D e .
We use GNNs to model observations of a dynamical system at discrete time points.
At each time point t , vertex i receives a D x -dimensional external input x ti .
We take D x to be the same for all vertices, and D x = 0 represents purely autonomous dynamics of a system.
The state of vertex i at time t is denoted as s ti , which is a vector of dimension D s .
Vertex states get updated by both time-varying inputs (when D x > 0 ) and the lateral interaction from neighboring vertices in the form of messages.
Along the edge ( i, j ) , a pairwise message m tij of dimension D m is generated by a message function
M ( · ) ,
[Equation]
where Θ M is the parameter of M ( · ) .
All incoming messages on vertex i are then aggregated via an aggregation function A ( · ) ,
[Equation]
A ( · ) takes the set of pairwise messages as input, ignoring their order, hence it is invariant to permutation.
Simple choices of A ( · ) include element-wise summation and max pooling, while more complicated mechanisms such as attention-based aggregation can also be used (Veli ˇ ckovi ´ c et {+al., 
+}
; Liao et al., 2019).
We choose summation in this study.
The vertex state is updated by an update function U ( · ) ,
[Equation]
where Θ U is the parameter of U ( · ) .
And finally, the GNN output is the projection of states via a readout function R ( · ) that applies to every vertex separately,
[Equation]
where Θ R is the parameter of R ( · ) .
There is an intrinsic degeneracy among M ( · ) , U ( · ) and R ( · ) : the complexity of one function may be compensated by the other two.
In this study, we use simple linear readouts, so all nonlinearities must be captured by message and update functions.
We also assume the readout function R ( · ) does not depend on vertex parameters v i .
2.2 Belief propagation on probabilistic graph models
A probabilistic graph model (PGM) describes a joint distribution of N random variables θ 1 , . .
, θ N .
Here we focus on PGMs with pairwise interactions.
In a graph of size N , each vertex i is associated with a singleton potential ϕ i ( θ i ) , and each undirected edge ( i, j ) is associated with a pairwise potential ψ ij ( θ i , θ j ) .
The joint distribution of ( θ 1 , . .
, θ N ) is proportional to the product of all potentials,
[Equation]
Marginalization of the joint distribution is one of the most used computation in statistical analysis, and many different methods have been developed for it, including belief propagation (BP), which is an iterative algorithm that operates on a PGM.
At each time point t , BP estimates the marginal distribution p
i ( θ i ) as ˆ p ti ( θ i ) .
BP is not guaranteed to converge, and even when it converges it is not guaranteed to converge to the true marginal distribution, however it provides a decent estimation in many cases (Murphy et al., 1999; Wainwright et al., 2003).
To make the BP dynamics more interesting, we use time-varying singleton potentials ϕ
ti ( θ i ) while keeping the pairwise potential ψ ij ( θ i , θ j ) constant.
This simulates a system with time-varying local evidence while the coupling among different parts is fixed.
BP output ˆ p ti ( x i ) therefore is the continuous estimate of p ti ( θ i ) determined by ϕ ti ( θ i ) and ψ ij ( θ i , θ j ) .
Related work
GNNs have been widely used to model time series of physical systems, often about predicting trajectories of interacting objects.
In Chang et al.
(2017); Bapst et al.
Sanchez-Gonzalez et al. (2020), the adjacency matrix of the interaction graph is determined by spatial proximity instead of being learned from data, therefore are not applicable for systems in which ‘neighborhood’ is not clearly defined (for instance probabilistic inference).
Chang et al.
(2017) demonstrates GNN can extrapolate to new environments containing more objects, but the structural properties of the system, namely the mass, is the same for all objects and environments.
Chang et al.
(2017) uses GNNs to infer latent properties such as object mass.
Similarly, Kipf et al. (2018) uses GNN to infer interaction type in a multi-object system.
However, the vertex and edge properties in these studies are designed as discrete values.
Our work instead investigates a spectrum of continuous graph properties and reveals the intrinsic low-dimensional structure of them.
Cranmer et al.
(2020) encourages a GNN model to learn compact internal representation, and performs symbolic regression based on it.
Our work reveals low-dimensional structure of GNNs also through regularization.
We analyze states and messages as vectors instead of just analyzing individual components, hence avoid the loss of information when representation is not perfectly factorized.
Also, we manage to disentangle the structural properties of the system ( e.g. mass, charge) instead of assuming they are known.
The graph translator proposed in our work can be seen as a more general form of symbolic regression which enables generalization to new instances of complex system.
Besides modeling physical systems, past work has used GNNs for probabilistic inference (Qu et al., 2019; Garcia Satorras et al., 2019).
GNN is often proposed as a better alternative to traditional BP algorithm, especially on loopy graphs (Yoon et al., 2019) or when higher-order statistics is critical (Zhang et al., 2019; Fei & Pitkow, 2021).
Our work instead focuses on using GNN to model BP algorithm as a dynamical system, whether it produces accurate probabilistic inference is outside the scope of this work.
Methods 4.1 Multi-graph training
An important merit of GNN is that the dynamical and structural aspects of a system are represented separately.
The canonical functions characterize the dynamics “law” of a certain type of system, such as the BP algorithm, while the graph parameters describe the structure of a particular system instance, e.g. the pairwise coupling in a PGM.
Because both aspects affect the system behavior, it is not trivial to disentangle them based on the observations of the system.
In order to inspect the effect of different structures while keeping the dynamics fixed, we need a large number of vertices and edges that cover a wide range of parameters, which suggests using a huge graph.
However, training GNN on a huge fully connected graph is computationally expensive.
Instead, a more feasible approach is to train multiple medium graphs simultaneously.
It is equivalent to training on a huge graph with the knowledge that it is a union of several disconnected components.
In this study, we prepare BP traces on multiple PGMs and simultaneously train multiple GNNs corresponding to each.
The GNNs share the same canonical functions but different graph parameters for each individual PGM.
The training objective function is simply the summation of loss function over all PGMs (Fig. 1a).
Each individual loss is designed to be proportional to the amount of data, therefore the trained canonical functions are naturally biased towards the PGMs with more training data.
[Figure]
[Figure]
We categorize the GNN parameters as dynamical parameters Θ D =
Θ M ∪ Θ U ∪ Θ R and structural parameters Θ S =
{ e ij } ∪ { v i } .
Denoting the number of GNN models as G , we need to learn one set of shared dynamical parameters Θ D , and G sets of structure parameters Θ S1 , . . .
, Θ S G for each
PGM respectively.
4.2 Problem formulation
We study the BP algorithm on a time-varying multivariate Gaussian distribution defined by
[Equation]
The joint distribution p ( θ ) can be rewritten as
[Equation]
with A ii = a i , A ij =
A ji = J ij as the precision matrix.
The bias time series b t is a sequence of constant values with random duration following a Poisson process, while switching between periods are smoothed by a Hamming window.
Since the marginal distributions p i ( θ i ) are also Gaussian distributions, BP on Gaussian distribution (Bickson, 2009) returns its single-variable means µ ti and standard deviations σ ti , i.e. ,
[Equation]
When converged, these means are exact but the standard deviations are approximate for loopy graphs (Weiss & Freeman, 2001).
We use a damped version of the BP algorithm so that belief update is slower, and add processing noise at each time step ( ?? ).
The damping parameter is adjusted so that transient dynamics makes up a significant portion of the full trial.
When the precision matrix A is constant, the estimated standard deviation σ ti quickly converges to the true value 1 √ a i independent of any time-dependent bias terms, so we focus on µ ti only.
An example trial of BP trace is shown in Fig.
1b.
The inputs to GNN are x ti =
[ b ti ] , and the targets for the GNN to match are defined as y ti =
[ µ ti ] .
The
GNN output o ti (Eq. 4) is constructed to have the same dimension as y ti , in this case of dimension 1.
We use the squared error L = (cid:80) i,t
∥ o ti − y ti ∥ 2 as the loss function.
As introduced in Section 4.1, the losses on all PGMs are summed up as the overall objective function.
In practice, each training batch is fetched from a randomly selected PGM.
Our loss includes L 2 regularization on the structural parameters Θ S
= { e ij } ∪ { v i } , which turn out to be critical in disentangling Θ S from Θ D (see
Section 5.5).
BP traces for 36 random PGMs are generated, using different number of variables, number of trials and time duration for each.
The graph density and coupling strengths are approximately the same for all PGMs.
More details can be found in Appendix D.
Results 5.1 Architecture comparison
The GNN architecture is determined by various hyper-parameters, including the underlying graph connectivity E , the dimensions D v , D e , D s , D m , and hidden layer sizes of canonical functions M ( · ) and U ( · ) .
We study the effect of hyper-parameters by performing an extensive search of model configurations and comparing the fitting quality of the trained GNNs.
We first define a set of possible values for each hyper-parameter, randomly choose combinations for a GNN architecture, and find the best architecture conditioned on each value to examine the effect of this hyper-parameter.
For example, if the candidate values for edge dimension D e are { 0 , 2 , 4 , 8 } , the best architectures found by hyper-parameter search conditioned on each D e value are compared.
[Figure]
Dashed line is the baseline performance, which is the median of MSE if noiseless BP traces is treated as prediction.
(b) BP target y ti against GNN output o ti of the best trained model.
The graph connectivity E is treated as a hyper-parameter because it is difficult to learn it in an end-to-end manner.
Without any prior knowledge of the structure of a system, the only fair choices are a null graph ( E = ∅ ) or a complete graph ( E = { ( i, j ) | ( i, j ) ∈
V 2 ∧ i ̸
= j } ).
The former (‘null’) assumes no coupling among variables, while the latter (‘full’)
assumes all pairs of coupling are possible.
Not surprisingly, ‘full’ GNNs fit data better than ‘null’ GNNs (Fig. 2a), demonstrating the necessity of pairwise messages for explaining the traces in our BP example.
It is worth mentioning that even the ‘null’ GNNs produce good fit ( R 2 = 0 . 923 ), because BP estimates µ ti in this example are largely determined by the singleton potentials ϕ
i ( x i ) and only slightly ‘pulled’ by other variables.
The reason for using the moderately coupled system is to avoid numerical instability of BP.
We next examine the effects of model component dimensions, including D v , D e , D s and D m .
The results (Fig. 2a ) show that a non-zero edge dimension is critical in fitting the BP traces on Gaussian distribution; the real coupling is a scalar and thus of dimension 1.
Surprisingly, the vertex dimension does not have to be greater than zero, even though the precision parameter A ii is a vertex attribute of dimension 1.
We will discuss how to identify ground truth dimension through graph translators in Section 6.
There is a small benefit of increasing state dimension D s , but no significant effect of message dimension D m .
It should be noticed that the best architecture for each conditioned value is usually different.
For example, the best configuration is ( D v = 0 , D e
= 8) for D m =
and ( D v = 4 , D v = 1) for D m = 12 .
Lastly we examine the effect of message function complexity characterized by the hidden layer sizes in M ( · ) , and find that nonlinearity in the message is crucial for GNNs to fit well (Fig. 2a).
Due to the high cost of hyper-parameter search, we do not compare different update functions, but fix it as a
GRU function modulated by the vertex parameter v i .
A more thorough search is left for future work.
To summarize, the results show strong dependency of fitting quality on graph connectivity, edge dimension and the message function nonlinearity, which indicates that in order to fit this dataset well, nonlinear messages between vertices are essential, and the GNN edges need to be parameterized.
5.2 GNN training result
One of the best architecture we find uses ‘full’ connectivity, D e = 2 , D v = 2 , D h = 12 , D m =and a message function with one hidden layer of size 16.
After a short initial burn-in period, the outputs of the trained GNNs faithfully reproduce the BP traces on the held-out testing set ( R 2 = 0 .
Fig. 2b).
Not only do the GNN outputs reach the same equilibrium as BP targets within each input period, but the temporal profile at each input switch is also accurate.
An example trial is shown in
Appendix E (Fig.
5.3 State and message manifold
We next analyze the states and messages of this well-trained GNN.
We gathered these time series from all graphs and performed principal component analysis (PCA) on them.
As expected, GNN states and messages only occupy a small portion of the high-dimensional space.
The effective dimension of the manifold is defined as ˜ D
=
( (cid:80) i λ i ) 2 (cid:80)
i λ 2 i , where λ i denotes the variance of the i -th PC.
When the state dimension is set to D s = 12 , the effective dimension of state manifold is only ˜ D s ≈ 1 .
(Fig. 3a).
We visualize GNN states in 2D and find they are organized by vertices.
States at each vertex form its own curved 1D manifold, slightly separated for different vertices (Fig. 3b).
[Figure]
We perform the same analysis on pairwise messages as well.
The effective dimension of messages is ˜ D m ≈ 3 .
37 for message dimension D m =
(Fig. 3c).
Different manifolds occupy the message space with different orientations and offsets.
Though messages gathered from all edges are not as structured as states, those on individual edges also trace out its own 1D manifold (Fig. 3d).
We analyze the dimensionality of aggregated messages m ti (Eq. 2) and find they also lie approximately on a 1D manifold specific to each vertex (Appendix F).
5.4 Interpretable canonical functions
With a clearer picture of the GNN states and messages, we next analyze the learned canonical functions U ( · ) and M ( · ) .
We take advantage of the fact that the states and messages conditioned on a vertex or an edge approximately lie on a curved 1-D manifold (Section 5.3).
Therefore we can project the states or messages on the leading PC for that vertex or edge, and use this projection as a proxy to visualize how these functions depend on their inputs.
Although inputs and outputs of U ( · ) and M ( · ) are vectors, we use scalar proxies as coordinates to plot heat maps of canoncial functions (Fig. 4).
[Figure]
For a GNN vertex with parameter v i , the update function U ( · ) (Eq. 3) is a function of s ti , x ti and m ti , in which the m ti is the aggregated message for vertex i at time t .
The input x ti is the external input, which is simply the local bias b ti in this case.
We denote the scalar proxies as ˜ s ti , ˜ s t +1 i and ˜ m ti respectively.
We then focus on the state change ∆˜ s ti = ˜ s t
+1 i − ˜ s ti as a function of x ti and ˜ m
ti .
Fig.
4a shows one example, in which the state change ∆˜ s ti is positive when ˜ m
ti is small and x ti is large, and is negative otherwise.
Hence ∆˜ s ti encodes the discrepancy between aggregated message ˜ m ti and the external input x ti .
For a GNN edge with parameter e ij , the message function M ( · ) (Eq. 1) is a function of s ti and s tj that returns m tij .
Again we denote corresponding scalar proxies as ˜ s ti , ˜ s tj and ˜ m tij .
It appears that ˜ m tij changes monotonically with either s ti or s tj , while depending mostly on the source vertex state ˜ s tj (Fig. 4b).
5.5 Graph translator
[Figure]
The structural parameters Θ S = { e ij } ∪ { v i } of each individual GNN are learned independently, and they should relate to the true parameters of the corresponding PGMs.
In a multivariate Gaussian distribution, a local precision parameter A ii is associated with each variable, and a coupling strength parameter A ij (Eq.
6–8) is associated with each pair of variables.
The hypothesis is that there exists a mapping between GNN vertex parameters v i and A ii , as well as between GNN edge parameters e ij and A ij .
We will learn this mapping between GNN structural parameters and the static attributes of the target nonlinear dynamical system, and term it a ‘graph translator’ because the conversion goes both ways.
Before learning the translators, we first look at the distribution of v i and e ij .
Though D v = D e =in the trained GNN, both vertex parameters and edge parameters approximately form a 1-D manifold.
Moreover, locations on the two manifolds are continuously mapped to the corresponding attributes of
PGM (Fig. 5).
The explicit structure that emerges in parameter space depends critically on the regularization of structural parameters during training.
Such low-dimensional structure does not show up without the
L 2 norm regularization on v i and e ij .
Well-trained but unregularized GNNs still give approximately the same good predictions of BP traces, but the effective dimensionality for vertex and edge parameters are very close to their embedding dimensions of D v and D e (Appendix G).
The graph translator we train is simply an MLP with two hidden layers, though it can be any regression model that predicts A ii from v i (vertex translator) or A ij from e ij (edge translator), or the opposite direction.
To quantitatively evaluate graph translators, we divide all G graphs into training, validation and testing sets.
Only the original PGM attributes ( e.g. A ii and A ij ) of training and validation graphs will be used to learn the graph translator, and the testing graphs will be used to evaluate how well the translator behaves.
The training graphs are used to train the translator directly, and the validation graphs are only used for early stopping.
We also assume it is expensive to obtain the original graph attributes ( e.g. in neuroscience applications it is laborious to measure synapse strength by patch-clamping experiments), so we use only a subset of the data in training and validation graphs.
Specifically, only 80% of the vertices or edges are randomly selected for training the corresponding graph translator.
All vertices and edges in the testing graphs are used for evaluation.
The translated local precision A ii and coupling strength A ij both match the ground truth well, with
R 2 = 0 .
946 and R 2 = 0 .
867 respectively (Fig. 6a).
Recovered coupling matrix A ij looks similar to the ground truth (Fig. 6b), revealing the correct interactions among different random variables.
Since we do not enforce any symmetry about GNN edges e ij , the recovered coupling matrix is not perfectly symmetric.
It is straightforward to reveal the underlying structural connectivity between variables by thresholding the coupling strength (Appendix H).
[Figure]
Graph translators can also be used in the reverse direction to directly construct GNN models for a given PGM.
The new GNN uses old dynamical parameter Θ D with the new structural parameter Θ S translated from precision matrix A .
We compare the constructed GNNs with two control models.
The first is the best trained colorless GNN with D v = D e = 0 , i.e. vertices and edges are homogeneous in a graph.
Colorless GNNs can be constructed for new PGM directly, without using a graph translator.
The second control is the best-trained GNNs with the same parameter dimension as the constructed one, namely the GNNs we obtained earlier for the testing graphs.
The graph parameters of constructed and trained GNNs are close to each other (Fig. 7a).
The constructed ˆ v i and ˆ e ij for the testing PGMs are close to the optimal values v ∗ i and e ∗ ij from the corresponding trained GNNs.
Although the strong bias terms ( b ti ) ensure that even disconnected
GNNs would capture some amount of the correct marginals, the colorless GNNs match true traces worst, indicating the benefits of parameterized edges.
The trained GNNs match true traces best, since they have access to trace data of the new PGM.
The translated GNNs, though never trained on these
BP traces, can generate credible traces (Fig. 7b). [Figure]
Conclusion and discussions
Using the belief propagation (BP) algorithm on Gaussian probabilistic graph models (PGM) as an example nonlinear dynamical system, we show that graph neural network (GNN) models can be trained on multiple instances of the same type of complex system.
Via architecture search, we identify that messages generated by a nonlinear function of states and heterogeneous GNN edges are needed for fitting the BP traces well.
We also show that the representation and canonical functions of GNN models have interpretations that are consistent with the principle of probabilistic inference.
We further propose the novel concept of a graph translator that links graph parameters in GNN models to graph attributes of the original system.
We show that the learned graph translator for Gaussian BP enables two types of generalization: recovering the precision matrix of a new Gaussian PGM from the traces of BP performing inference, and to construct GNN model for a new Gaussian PGM in order to reproduce BP algorithm without knowing its implementation.
Unlike generalization to new inputs, such generalization to new instances of the same system builds on the successful disentanglement between dynamics and structure.
We find regularization is crucial to disentangle dynamical parameters
Θ D =
Θ M ∪ Θ U ∪ Θ R and structural parameters Θ S =
{ e ij } ∪ { v i } .
When no regularization is used during GNN training, the learned Θ S does not show clear structure despite the fact that multiple PGMs are trained together.
L 2 norm regularization on vertex and edge parameters v i and e ij is used in our study, but other options might also work, e.g. regularization on states s i or messages m ij .
We also observed that low-dimensional structure of GNN states s i and messages m ij is still present when no regularization is used (Appendix G).
Though BP on Gaussian PGM is an important probabilistic inference algorithm, its dynamics are undoubtedly still simple.
In future work we would like to test our framework in other complex systems such as celestial mechanics, epidemiology, population ecology, and neuroscience.
More advanced GNN architecture is perhaps necessary for these applications, such as stacking GNN layers or attention-based message aggregation.
One straightforward next step is to study PGMs with more complicated couplings, for instance a multivariate von Mises distribution whose pairwise potential ψ ij ( θ i , θ j ) is specified by 4 free parameters.
We predict that GNN edge dimension D e has to be at least 4 to faithfully model BP traces on such PGMs.
In this study, we make zero assumption about the connectivity of the underlying graph, which leaves us to choose either a null graph or a fully connected one.
However the connectivity can also be learned in principle if proper inductive bias is imposed, e.g. a sparsity prior, proximity rules, etc.
In fact, one can try to estimate the connectivity from the learned fully connected edge parameters e ij and use these estimates as the graph’s edges E for the next iteration of GNN training.
Approaches that learn connectivity end-to-end should also be explored.
From fitting quality alone, we obtain a basic picture on the dimensions of the complex system (Fig. 2), but identification of the exact values of D v , D e , D s and D m is still an open question.
Preliminary data suggests that it is possible to identify them using generalization performance on new instances (Fig. 7) as a metric.
Only the GNNs with correct assumptions about dimensions can accurately predict system behavior on a new instance, because either underestimation or overestimation will result ‘incorrectly’ constructed GNNs.
We will examine the results further, also include D v =
and
D e = 1 in the architecture search.
A Meta-MLP
We design a family of MLPs organized by meta-parameters, called meta-MLP or mMLP for short.
In an original MLP, the input vector x is defined as layer 0 activation x 0 .
L sequential perceptrons transform activation from one layer to the next by
[Equation]
in which W l and b l are the weight and bias of layer l respectively, and f l ( · ) is the nonlinear activation function of layer l .
The L -th layer activation x L is defined as the output of the MLP,
[Equation]
[Equation]
with Θ = { W 1 , b 1 , . . .
, W L , b L } .
In an mMLP with meta-parameter ζ , each layer is defined as
[Equation]
In Eq.
12, the meta-parameter ζ modulates each layer transformation by acting as an extra input.
The output of the mMLP is defined as the last layer activation
[Equation]
Optionally, batch normalization layers can be added right before each nonlinear activation function.
When a batch normalization layer with trainable affine transformation is added, the bias b l will be removed.
In this study, all layers in an mMLP except the last one use the nonlinear ELU activation, i.e.
[Equation]
for 1 ≤ l < L .
The activation function of last layer is the identity function f L ( z )
=
z .
B Canonical functions B.1 Message function
In this study, the message function M ( · ) is defined as
[Equation]
While message parameter Θ M is shared across all edges, meta-parameter e ij are different for different edges.
B.2 Update function
We use a modified version of gated recurrent unit (GRU) function (Cho et al., 2014) as the update function U ( · ) (Eq. 1).
The form of original GRU update is
[Equation]
in which x t and s t are the external input and hidden state at time t respectively.
z t and r t are the update gate and reset gate vectors, while σ g ( · ) and σ s ( · ) are nonlinear functions typically chosen as logistic function and hyperbolic tangent function respectively.
While original GRU uses perceptrons for gates and state updates, we replace them by meta-MLPs with vertex parameter v i .
We do not append nonlinear activation to the last layer of mMLP (Appendix A), hence the gating nonlinearities σ g and σ s are kept.
Another difference is each vertex receives not only external input, but also aggregated messages from neighbors.
The update function U ( · ) (Eq. 3) is defined through
[Equation]
The update parameter is defined as Θ U =
Θ U z ∪ Θ U r ∪
Θ U s .
B.3 Readout function
We choose a simple linear function as canonical readout R ( · ) (Eq. 4),
[Equation]
with readout parameter Θ R = { W R , b R } .
C Noisy belief propagation algorithm
We use belief propagation (BP) algorithm to estimate the marginal distribution of all variables.
We define the message from vertex j to i as m ij ( θ i ) , namely the belief about i from j .
At each iteration,
BP updates m ij ( θ i ) to
[Equation]
in which N( j ) is the set of neighbors of j .
The marginal distribution of θ i is
[Equation]
We explicitly normalize messages and estimated marginal distributions at each iteration.
BP is not guaranteed to converge on loopy graphs, even when it converges it may not converge to the true marginal distribution.
However if damping update is used, BP usually gives a stable good approximation and can be considered as a valid inference algorithm.
We denote the damping coefficient as γ .
BP updates messages in logarithm domain following
[Equation] [Equation]
with superscript t marks the time step in BP.
Here the singleton potential ϕ ti ( θ i ) changes over time.
Similarly, the estimated marginal distribution is also dynamic,
[Equation]
We additionally add processing noise to the inference algorithm to mimic a physical system.
Since the message by definition is non-negative, we use additive noise in logarithmic domain to distort each update step.
The complete form is
[Equation]
in which n ti ∼ N (0 , σ 2n ) is independent Gaussian noise with variance σ 2n .
D Trace data
BP traces are generated for 36 PGMs.
For each PGM, its graph size is randomly sampled from { 12 , 14 , 16 , 18 } , the BP duration is randomly sampled from { 80 , 100 , 120 } , and the number of trials is randomly sampled from { 1000 , 1250 , 1500 } .
Precision matrix of each PGM is a random positivedefinite matrix, generated by applying random rotations on a subset of indices starting from a diagonal matrix until desired density is reached (similar to ‘sprandsym’ function in MATLAB).
The reciprocal condition number is 0.2, and the desired density is 60% (estimated using a threshold of ϵ = {+
+}
.when
the starting diagonal matrix has maximum value of 1).
The full dataset includes approximately 75 million data points (graph size × duration × number of trials, summed up for all 36 PGMs).
90%, 5% and 5% of the data are used for training, validation and testing respectively.
E Example trial of the best GNN
An example trial of the best fit GNN (Fig. 2b) is shown in Fig.
Since no processing noise is introduced in GNN, its output is smoother than the target traces given by noisy BP algorithm.
The trained GNN captures main component of observed dynamical data, effectively removing the noise within.
F PCA on aggregated messages
PCA is performed on the aggregated messages m ti (Eq. 2) for the trained GNN.
Similar to the geometry of states s ti (Fig. 3), aggregated messages for each vertex also lie on a curved 1-D manifold in the high-dimensional space.
[Figure]
G Training with no regularization
When no regularization is added on structural parameters v i and e ij , the trained GNN can still predict
BP traces well.
One of the best architectures we found is D e = 8 , D v = 4 , D message function with two hidden layers of size [32, 16].
Though the its fitting performance is high ( R 2 = 0 . 989 ), PCA on the learned v i and e ij does not reveal low-dimensional manifold.
[Figure]
However, PCA on the states and pairwise messages of the trained GNNs still show low-dimensional structure, similar to Fig. 3.
In fact, the messages seem to be more organized as the 1-D manifolds belonging to different edges are aligned parallel.
[Figure]
H Connectivity prediction
When two nodes are correlated, it does not necessarily indicate there is an edge connecting them.
The underlying graph we use is not fully connected, i e. some values of the coupling matrix A ij is set to 0.
We predict the connectivity by thresholding either the activity correlation matrix ρ ij or the coupling matrix ˆ A ij recovered by edge translator (Fig. 12a) and plot the ROC curves for both case (Fig. 12b).
Area under the curve (AUC) is larger for the prediction from recovered coupling matrix.
[Figure]