Multiresolution Equivariant Graph Variational Autoencoder
Abstract
In this paper, we propose Multiresolution Equivariant Graph Variational Autoencoders (MGVAE), the ﬁrst hierarchical generative model to learn and generate graphs in a multiresolution and equivariant manner.
At each resolution level,
MGVAE employs higher order message passing to encode the graph while learning to partition it into mutually exclusive clusters and coarsening into a lower resolution that eventually creates a hierarchy of latent distributions.
MGVAE then constructs a hierarchical generative model to variationally decode into a hierarchy of coarsened graphs.
Importantly, our proposed framework is end-to-end permutation equivariant with respect to node ordering.
MGVAE achieves competitive results with several generative tasks including general graph generation, molecular generation, unsupervised molecular representation learning to predict molecular properties, link prediction on citation graphs, and graph-based image generation.
1. Introduction
Understanding graphs in a multiscale and multiresolution perspective is essential for capturing the structure of molecules, social networks, or the World Wide Web.
Graph neural networks (GNNs) utilizing various ways of generalizing the concept of convolution to graphs (Scarselli et al., 2009) (Niepert et al., 2016) (Li et al., 2016) have been widely applied to many learning tasks, including modeling physical systems (Battaglia et al., 2016), ﬁnding molecular representations to estimate quantum chemical computation (Duvenaud et al., 2015) (Kearnes et al., 2016)
(Gilmer et al., 2017)
(Hy et al., 2018), and protein interface prediction (Fout et al., 2017).
One of the most popular types of
GNNs is message passing neural nets (MPNNs) that are constructed based on the message passing scheme in which each node propagates and aggregates information, encoded by vectorized messages, to and from its local neighborhood.
While this framework has been immensely successful in many applications, it lacks the ability to capture the multiscale and multiresolution structures that are present in complex graphs (Rustamov & Guibas, 2013)
(Chen et al., 2014)
(Cheng et al., 2015)
(Xu et al., 2019).
Ying et al.
(2018) proposed a multiresolution graph neural network that employs a differential pooling operator to coarsen the graph.
While this approach is effective in some settings, it is based on soft assigment matrices, which means that (a) the sparsity of the graph is quickly lost in higher layers (b) the algorithm isn’t able to learn an actual hard clustering of the vertices.
The latter is important in applications such as learning molecular graphs, where clusters should ideally be interpretable as concrete subunits of the graphs, e.g., functional groups.
In contrast, in this paper we propose an arhictecture called
Multiresolution Graph Network (MGN) , and its generative cousin, Multiresolution Graph Variational Autoencoder (MGVAE), which explicitly learn a multilevel hard clustering of the vertices, leading to a true multiresolution hierarchy.
In the decoding stage, to “uncoarsen” the graph,
MGVAE needs to generate local adjacency matrices, which is inherently a second order task with respect to the action of permutations on the vertices, hence MGVAE needs to leverage the recently developed framework of higher order permutation equivariant message passing networks (Hy et al., 2018; Maron et al., 2019b).
Learning to generate graphs with deep generative models is a difﬁcult problem because graphs are combinatorial objects that typically have high order correlations between their discrete substructures (subgraphs)
(You et al., 2018a)
(Li et al., 2018)
(Liao et al., 2019) (Liu et al., 2019)
(Dai et al., 2020).
Graph-based molecular generation (G´omezBombarelli et al., 2018)
(Simonovsky & Komodakis, 2018)
(Cao & Kipf, 2018) (Jin et al., 2018)
(Thiede et al., 2020) involves further challenges, including correctly recognizing chemical substructures, and importantly, ensuring that the generated molecular graphs are chemically valid.
MGN allows us to extend the existing model of variational autoencoders (VAEs) with a hierarchy of latent distributions that can stochastically generate a graph in multiple resolution levels.
Our experiments show that having a ﬂexible clustering procedure from MGN enables MGVAE to detect, reconstruct and ﬁnally generate important graph substructures, especially chemical functional groups.
2. Related work
There have been signiﬁcant advances in understanding the invariance and equivariance properties of neural networks in general (Cohen & Welling, 2016)
(Cohen & Welling, 2017), of graph neural networks (Kondor et al., 2018)
(Maron et al., 2019b), of neural networks learning on sets (Zaheer et al., 2017) (Serviansky et al., 2020)
(Maron et al., 2020), along with their expressive power on graphs (Maron et al., 2019c) (Maron et al., 2019a).
Our work is in line with group equivariant networks operating on graphs and sets.
Multiscale, multilevel, multiresolution and coarse-grained techniques have been widely applied to graphs and discrete domains such as diffusion wavelets (Coifman & Maggioni, 2006); spectral wavelets on graphs (Hammond et al., 2011); ﬁnding graph wavelets based on partitioning/clustering (Rustamov & Guibas, 2013); graph clustering and ﬁnding balanced cuts on large graphs (Dhillon et al., 2005)
(Dhillon et al., 2007)
(Chiang et al., 2012)
(Si et al., 2014); and link prediction on social networks (Shin et al., 2012).
Prior to our work, some authors such as (Zhou et al., 2019) proposed a multiscale generative model on graphs using GAN (Goodfellow et al., 2014), but the hierarchical structure was built by heuristics algorithm, not learnable and not ﬂexible to new data that is also an existing limitation of the ﬁeld.
In general, our work exploits the powerful group equivariant networks to encode a graph and to learn to form balanced partitions via back-propagation in a data-driven manner without using any heuristics as in the existing works.
In the ﬁeld of deep generative models, it is generally recognized that introducing a hierarchy of latents and adding stochasticity among latents leads to more powerful models capable of learning more complicated distributions (Blei et al., 2003)
(Ranganath et al., 2016) (Ingraham & Marks, 2017) (Klushyn et al., 2019)
(Wu et al., 2020) (Vahdat &
Kautz, 2020).
Our work combines the hierarchical variational autoencoder with learning to construct the hierarchy that results into a generative model able to generate graphs at many resolution levels.
3. Multiresolution graph network 3.1. Construction
An undirected weighted graph G =
(V , E , A , F v , F e ) with node set V and edge set E is represented by an adjacency matrix A ∈ N ∣V∣×∣V∣ , where A ij > 0 implies an edge between node v i and v j with weight
A ij (e.g., A ij ∈ { 0 , 1 } in the case of unweighted graph); while node features are represented by a matrix F v ∈ R ∣V∣× d v , and edge features
[Figure]
are represented by a tensor F e ∈ R ∣V∣×∣V∣× d e .
The secondorder tensor representation of edge features is necessary for our higher-order message passing networks described in the next section.
Indeed, F v can be encoded in the diagonal of
F e .
Deﬁnition 3.1.
A K -cluster partition of graph G is a partition of the set of nodes V into K mutually exclusive clusters
V 1 ,.., V K .
Each cluster corresponds to an induced subgraph
G k = G[V k ] .
Deﬁnition 3.2.
A coarsening of G is a graph ˜ G of K nodes deﬁned by a K -cluster partition in which node ˜ v k of ˜ G corresponds to the induced subgraph G k .
The weighted adjacency matrix ˜
A ∈ N K × K of ˜ G is
[Equation]
where the diagonal of ˜
A denotes the number of edges inside each cluster, while the off-diagonal denotes the number of edges between two clusters.
Fig.
3.1 shows an example of Defs.
3.1 and 3.2: a 3 -cluster partition of the Aspirin C 9 H 8 O 4 molecular graph and its coarsening graph.
Def.
3.3 deﬁnes the multiresolution of graph G in a bottom-up manner in which the bottom level is the highest resolution (e.g., G itself) while the top level is the lowest resolution (e.g., G is coarsened into a single node).
Deﬁnition 3.3.
An L -level coarsening of a graph G is a series of L graphs G ( 1 ) ,.., G ( L ) in which 1.
G ( L ) is G itself.
For 1 ≤ (cid:96) ≤ L − 1 , G ( (cid:96) ) is a coarsening graph of G ( (cid:96) + 1 ) as deﬁned in Def. 3.2.
The number of nodes in G ( (cid:96) ) is equal to the number of clusters in G ( (cid:96) + 1 ) .
The top level coarsening G ( 1 ) is a graph consisting of a single node, and the corresponding adjacency matrix
A ( 1 ) ∈ N 1 × 1 .
Deﬁnition 3.4.
An L -level Multiresolution Graph Network (MGN) of a graph G consists of L − 1 tuples of ﬁve network components {( c ( (cid:96) ) ,
e ( (cid:96) ) local , d ( (cid:96) ) local , d ( (cid:96) ) global , p ( (cid:96) ) )
} L(cid:96)
= 2 .
The (cid:96) -th
tuple encodes G ( (cid:96) ) and transforms it into a lower resolution graph G ( (cid:96) − 1 ) in the higher level.
Each of these network components has a separate set of learnable parameters ( θ ( (cid:96) ) 1 , θ ( (cid:96) ) 2 , θ ( (cid:96) ) 3 , θ ( (cid:96) ) 4 , θ ( (cid:96) ) 5 ) .
For simplicity, we collectively denote the learnable parameters as θ , and drop the superscript.
The network components are deﬁned as follows:
Clustering procedure c (G ( (cid:96) ) ; θ ) , which partitions graph G ( (cid:96) ) into K clusters V ( (cid:96) ) 1 ,..., V ( (cid:96) ) K .
Each cluster is an induced subgraph G ( (cid:96) )
k of G ( (cid:96) ) with adjacency matrix A ( (cid:96) )
k . 2.
Local encoder e local (G ( (cid:96) )
k ; θ ) , which is a permutation equivariant (see Defs.
3.5, 3.6) graph neural network that takes as input the subgraph G ( (cid:96) )
k , and outputs a set of node latents Z ( (cid:96) )
k represented as a matrix of size ∣V ( (cid:96) )
k ∣ × d z . 3.
Local decoder d local (Z ( (cid:96) )
k ; θ ) , which is a permutation equivariant neural network that tries to reconstruct the subgraph adjacency matrix A ( (cid:96) )
k for each cluster from the local encoder’s output latents.
(Optional)
Global decoder d global (Z ( (cid:96) ) ; θ ) , which is a permutation equivariant neural network that reconstructs the full adjacency matrix A ( (cid:96) ) from all the node latents of K clusters
Z ( (cid:96) ) =
⊕ k Z
( (cid:96) )
k represented as a matrix of size ∣V ( (cid:96) )
∣ × d z . 5.
Pooling network p (Z ( (cid:96) )
k ; θ ) , which is a permutation invariant (see Defs.
3.5, 3.6) neural network that takes the set of node latents Z ( (cid:96) )
k and outputs a single cluster latent
˜ z ( (cid:96) )
k ∈ d z .
The coarsening graph G ( (cid:96) − 1 ) has adjacency matrix A ( (cid:96) − 1 ) built as in Def. 3.2, and the corresponding node features Z ( (cid:96) − 1 ) =
⊕ k ˜ z
( (cid:96) )
k
repre-
sented as a matrix of size K × d z .
Algorithmically, MGN works in a bottom-up manner as a tree-like hierarchy starting from the highest resolution graph
G ( L ) , going to the lowest resolution G ( 1 ) (see Fig. 3.1).
Iteratively, at (cid:96) -th level, MGN partitions the current graph into K clusters by running the clustering procedure c ( (cid:96) ) .
Then, the local encoder e ( (cid:96) ) local and local decoder d ( (cid:96) )
global operate on each of the K subgraphs separately, and can be executed in parallel.
This encoder/decoder pair is
[Table]
responsible for capturing the local structures.
Finally, the pooling network p ( (cid:96) ) shrinks each cluster into a single node of the next level.
Optionally, the global decoder d ( (cid:96) ) global makes sure that the whole set of node latents
Z ( (cid:96) ) is able to capture the inter-connection between clusters.
In terms of time and space complexity, MGN is more efﬁcient than existing methods in the ﬁeld.
The cost of global decoding the highest resolution graph is proportional to ∣V∣ 2 .
For example, while the encoder can exploit the sparsity of the graph and has complexity O(∣E∣) , a simple dot-product decoder d global (Z) = sigmoid (ZZ T ) has both time and space complexity of O(∣V∣ 2 ) which is infeasible for large graphs.
In contrast, the cost of running
K local dot-product decoders is O(∣V∣ 2 / K ) , which is approximately K times more efﬁcient.
3.2. Higher order message passing
In this paper we consider permutation symmetry, i.e., symmetry to the action of the symmetric group, S n .
An element σ ∈ S n is a permutation of order n , or a bijective map from { 1 ,...,n } to { 1 ,...,n } .
The action of S n on an adjacency matrix A ∈ R n × n and on a latent matrix Z ∈ R n × d z are [ σ ⋅ A] i 1 ,i
=
A σ − 1 ( i 1 ) ,σ − 1 ( i 2 ) , [ σ ⋅ Z] i,j = Z σ − 1 ( i ) ,j , for σ ∈ S n .
Here, the adjacency matrix A is a second order tensor with a single feature channel, while the latent matrix
Z is a ﬁrst order tensor with d z feature channels.
In general, the action of S n on a k -th order tensor X ∈ R n k × d (the last index denotes the feature channels) is deﬁned similarly as:
[Equation]
Network components of MGN (as deﬁned in Sec. 3.1) at each resolution level must be either equivariant , or invariant with respect to the permutation action on the node order of
G ( (cid:96) ) .
Formally, we deﬁne these properties in Def. 3.5.
Deﬁnition 3.5.
An S n -equivariant (or permutation equivariant) function is a function f
∶ R n k ×
d → R n k ′ ×
d ′ that satisﬁes f ( σ ⋅X) =
σ ⋅ f (X) for all σ ∈ S n and X ∈ R n k × d .
Similarly, we say that f is S n -invariant (or permutation invariant) if and only if f ( σ ⋅ X) =
f (X) .
Deﬁnition 3.6.
An S n -equivariant network is a function f
∶ R n k ×
d → R n k ′ ×
d ′ deﬁned as a composition of S nequivariant linear functions f 1 ,..,f T and S n -equivariant nonlinearities γ 1 ,..,γ T :
[Equation]
On the another hand, an S n -invariant network is a function f
∶ R n k ×
d → R deﬁned as a composition of an S nequivariant network f ′ and an S n -invariant function on top of it, e.g., f = f ′′
○ f ′ .
In order to build higher order equivariant networks, we revisit some basic tensor operations: the tensor product A ⊗ B and tensor contraction
A ↓ x 1 ,..,x p (details and deﬁnitions are
Sec.
A).
It can be shown that these tensor operations respect permutation equivariance (Hy et al., 2018)
(Kondor et al., 2018).
Based on these tensor contractions and Def. 3.5, we can construct the second-order S n -equivariant networks as in Def.
3.6 (see Example 3.2): f = γ ○M T
○ ..
○ γ ○M 1 .
The second-order networks are particularly essential for us to extend the original variational autoencoder (VAE) (Kingma & Welling, 2014) model that approximates the posterior distribution by an isotropic Gaussian distribution with a diagonal covariance matrix and uses a ﬁxed prior distribution
N( 0 , 1 ) .
In constrast, we generalize by modeling the posterior by N( µ, Σ ) in which Σ is a full covariance matrix, and we learn an adaptive parameterized prior N( ˆ µ, ˆΣ ) instead of a ﬁxed one.
Only the second-order encoders can output a permutation equivariant full covariance matrix, while lowerorder networks such as MPNNs are unable to.
See Sec.
B and C for details.
The second order message passing has the message H 0 ∈ R ∣V∣×∣V∣×( d v + d e ) initialized by promoting the node features
F v to a second order tensor (e.g., we treat node features as self-loop edge features), and concatenating with the edge features F e .
Iteratively,
[Equation]
where A ⊗ H t − 1 results in a fourth order tensor while ↓ i,j contracts it down to a second order tensor along the i -th and j -th dimensions, ⊕ denotes concatenation along the feature channels, and W t denotes a multilayer perceptron on the feature channels.
We remark that the popular MPNNs (Gilmer et al., 2017) is a lower-order one and a special case in which M t
=
D − 1 AH t − 1 W t − 1 where D ii =
∑ j A ij is the diagonal matrix of node degrees.
The message H T of the last iteration is still second order, so we contract it down to the ﬁrst order latent Z = ⊕ i H T ↓ i .
3.3. Learning to cluster
Deﬁnition 3.7.
A clustering of n objects into k clusters is a mapping π ∶ { 1 ,..,n } → { 1 ,..,k } in which π ( i ) =
j if the i -th object is assigned to the j -th cluster.
The inverse mapping π − 1 ( j ) =
{ i ∈ [ 1 ,n ] ∶ π ( i ) =
j } gives the set of all objects assigned to the j -th cluster.
The clustering is represented by an assignment matrix Π ∈ { 0 , 1 } n × k such that Π i,π ( i ) = 1 .
Deﬁnition 3.8.
The action of S n on a clustering π of n objects into k clusters and its corresponding assignment matrix Π are
[Equation]
Deﬁnition 3.9.
Let N be a neural network that takes as input a graph G of n nodes, and outputs a clustering π of k clusters.
N is said to be equivariant if and only if
N( σ ⋅ G) =
σ ⋅ N(G) for all σ ∈ S n .
From Def. 3.9, intuitively the assignement matrix Π still represents the same clustering if we permute its rows.
The learnable clustering procedure c (G ( (cid:96) ) ; θ ) is built as follows:
A graph neural network parameterized by θ encodes graph G ( (cid:96) ) into a ﬁrst order tensor of K feature channels
[Equation]
The clustering assignment is determined by a row-wise maximum pooling operation:
[Equation]
) i,k (1) that is an equivariant clustering in the sense of Def. 3.9.
A composition of an equivariant function (e.g., graph net) and an equivariant function (e.g., maximum pooling given in Eq. 1) is still an equivariant function with respect to the node permutation.
Thus, the learnable clustering procedure c (G ( (cid:96) ) ; θ ) is permutation equivariant.
In practice, in order to make the clustering procedure differentiable for backpropagation, we replace the maximum pooling in Eq.
1 by sampling from a categorical distribution.
Let π ( (cid:96) )
( i ) be a categorical variable with class probabilities p
( (cid:96) )
i, 1 ,..,p ( (cid:96) )
i,K computed as softmax from ˜ p
( (cid:96) )
i, ∶ .
The Gumbelmax trick (Gumbel, 1954)(Maddison et al., 2014)(Jang et al.,
2017) provides a simple and efﬁcient way to draw samples π ( (cid:96) )
( i ) :
[Equation]
where g i, 1 ,..,g i,K are i.i.d samples drawn from
Gumbel ( 0 , 1 ) .
Given the clustering assignment matrix Π ( (cid:96) ) , the coarsened adjacency matrix A ( (cid:96) − 1 ) (see
Defs.
3.1 and 3.2) can be constructed as Π ( (cid:96) )
T A ( (cid:96) )
Π ( (cid:96) ) .
It is desirable to have a balanced K -cluster partition in which clusters V ( (cid:96) ) 1 ,.., V ( (cid:96) )
K have similar sizes that are close to ∣V ( (cid:96) )
∣/ K .
The local encoders tend to generalize better for same-size subgraphs.
We want the distribution of nodes into clusters to be close to the uniform distribution.
We enforce the clustering procedure to produce a balanced cut by minimizing the following Kullback–Leibler divergence:
[Equation]
where
[Equation]
The whole construction of MGN is equivariant with respect to node permutations of G .
In the case of molecular property prediction, we want MGN to learn to predict a real value y ∈ R for each graph G while learning to ﬁnd a balanced cut in each resolution to construct a hierarchical structure of latents and coarsen graphs.
The total loss function is
[Equation]
where f is a multilayer perceptron, ⊕ denotes the vector concatenation, R is a readout function that produces a permutation invariant vector of size d
given the latent
Z ∣V ( (cid:96) )
∣×
d at the (cid:96) -th resolution, λ ( (cid:96) )
∈ R is a hyperparamter, and D KL ( P ( (cid:96) )
∣∣
Q ( (cid:96) ) ) is the balanced-cut loss as deﬁned in
Eq. 2.
4. Hierarchical generative model
In this section, we introduce our hierarchical generative model for multiresolution graph generation based on variational principles.
4.1. Background on graph variational autoencoder
Suppose that we have input data consisting of m graphs (data points)
G =
{G 1 ,.., G m } .
The standard variational autoencoders (VAEs), introduced by (Kingma & Welling, 2014) have the following generation process, in which each data graph G i for i ∈ { 1 , 2 ,..,m } is generated independently:
Generate the latent variables
Z
= {Z 1 ,.., Z m } , where each Z i ∈ R ∣V i ∣×
d z is drawn i.i.d.
from a prior distribution p
(e.g., standard Normal distribution N( 0 , 1 ) ).
Generate the data graph G i ∼ p θ (G i ∣Z i ) from the model conditional distribution p θ .
We want to optimize θ to maximize the likelihood p θ (G) = ∫ p θ (Z) p θ (G∣Z)
d Z .
However, this requires computing the posterior distribution p θ (G∣Z)
=
∏ mi = 1 p
θ
(G i ∣Z i ) , which is usually intractable.
Instead, VAEs apply the variational principle, proposed by (Wainwright & Jordan, 2005), to approximate the posterior distribution as q φ (Z∣G) =
∏ mi = 1 q φ (Z i ∣G i ) via amortized inference and maximize the evidence lower bound (ELBO) that is a lower bound of the likelihood:
[Equation]
The probabilistic encoder q φ (Z∣G) , the approximation to the posterior of the generative model p θ (G , Z) , is modeled using equivariant graph neural networks (see Example 3.2) as follows.
Assume the prior over the latent variables to be the centered isotropic multivariate Gaussian p θ (Z) =
N(Z ;0 ,I ) .
We let q φ (Z i ∣G i ) be a multivariate Gaussian with a diagonal covariance structure:
[Equation]
where µ i ,σ i ∈ R ∣V i ∣× d z are the mean and standard deviation of the approximate posterior output by two equivariant graph encoders.
We sample from the posterior q φ by using the reparameterization trick: Z i = µ i + σ i ⊙ (cid:15) , where (cid:15) ∼ N( 0 ,I ) and ⊙ is the element-wise product.
On the another hand, the probabilistic decoder p θ (G i ∣Z i ) deﬁnes a conditional distribution over the entries of the adjacency matrix
A i : p
[Equation] [Equation]
Z iv ) .
For example, (Kipf & Welling, 2016) suggests a simple dot-product decoder that is trivially equivariant:
[Equation]
) , where γ denotes the sigmoid function.
4.2. Multiresolution VAEs
Based on the construction of multiresolution graph network (see Sec. 3.1), the latent variables are partitioned into disjoint groups, Z i =
[Equation] [Equation]
i ,
[Equation] [Equation]
[Equation]
L
[Equation]
i } where Z (
[Equation]
= {[Z (
[Equation]
) i ] k
[Equation]
∣[
[Equation]
) i ] k ∣× d z } k is the set of latents at the (cid:96) -th resolution level in which the graph G ( (cid:96) )
i is partitioned into a number of clusters [G ( (cid:96) )
i ] k .
In the area of normalzing ﬂows (NFs), (Wu et al., 2020) has shown that stochasticity (e.g., a chain of stochastic sampling blocks) overcomes expressivity limitations of NFs.
In general, our MGVAE is a stochastic version of the deterministic
MGN such that stochastic sampling is applied at each resolution level in a bottom-up manner.
The prior (Eq. 5) and the approximate posterior (Eq. 6) are represented by
[Equation]
in which each conditional in the approximate posterior are in the form of factorial Normal distributions, in particular
[Equation]
where each encoder q φ ([Z (
[Equation]
) i ] k ∣Z (
[Equation]
+
[Equation] [Equation]
, [G ( (cid:96) ) i ] k ) operates on a subgraph [G ( (cid:96) )
i ] k as follows:
• The pooling network p ( (cid:96) + 1 ) shrinks the latent Z ( (cid:96) + 1 )
i into the node features of G ( (cid:96) )
i as in the construction of MGN (see Def. 3.4).
• The local (deterministic) graph encoder d ( (cid:96) ) local encodes each subgraph
[G ( (cid:96) ) i ] k into a mean vector and a diagonal covariance matrix (see Eq. 4).
A second order encoder can produce a positive semideﬁnite non-diagonal covariance matrix, that can be interpreted as a Gaussian Markov Random Fields (details in Sec. B).
The new subgraph latent [Z ( (cid:96) )
i ] k is sampled by the reparameterization trick.
The prior can be either the isotropic Gaussian N( 0 , 1 ) as in standard VAEs, or be implemented as a parameterized
Gaussian N( ˆ µ, ˆΣ ) where ˆ µ and ˆΣ are learnable equivariant functions (details in Sec.
C).
The reparameterization trick for conventional N( 0 , 1 ) prior is the same as in Sec.
4.1, while the new one for the generalized and learnable prior
N( ˆ µ, ˆΣ ) is given in Sec.
B. On the another hand, the probabilistic decoder p θ (G ( 1 ) i ,.., G ( L ) i ∣Z
[Equation]
) deﬁnes a conditional distribution over all subgraph adjacencies at each resolution level:
[Equation]
molecules on QM9 (4 on top) and
ZINC (bottom) equivariantly.
There are many more examples of generated molecules in Sec.
D.2.
Both equivariant MGVAE and autoregressive MGN generate high-quality molecules with complicated structures such as rings.
Extending from Eq.
3, we write our multiresolution variational lower bound L MGVAE ( φ,θ ) on log p
(G) compactly as
[Equation]
where the ﬁrst term denotes the reconstruction loss (e.g., ∣∣A ( (cid:96) )
i − ˆ A
[Equation]
) i ∣∣ where A ( L ) i is G i itself, A ( (cid:96) <
L ) i is the adjacency produced by MGN at level (cid:96) , and ˆ A ( (cid:96) )
i are the reconstructed ones by the decoders); and the second term is indeed D KL (N( µ ( (cid:96) )
i , Σ ( (cid:96) )
i )∣∣N( ˆ µ ( (cid:96) ) , ˆΣ ( (cid:96) ) ))
where µ ( (cid:96) )
i ∈
R ∣V ( (cid:96) )
i ∣× d and Σ ( (cid:96) )
i ∈ R ∣V ( (cid:96) )
i ∣×∣V
( (cid:96) )
i ∣× d are the mean and covariance tensors produced by the (cid:96) -th encoder for graph
G i , while ˆ µ ( (cid:96) ) and ˆΣ ( (cid:96) ) are learnable ones in an equivariant manner as in Sec.
C.
In general, the overall optimization is given as follows:
[Equation]
) where φ denotes all learnable parameters of the encoders, θ denotes all learnable parameters of the decoders, and
D KL ( P ( (cid:96) )
i ∣∣ Q ( (cid:96) ) i ) is the balanced-cut loss for graph G i at level (cid:96) as deﬁned in Sec. 3.3.
5. Experiments
Many more experimental results and details are presented in the Sec.
D of the Appendix.
Our source code is available at https://github.com/HyTruongSon/MGVAE .
5.1. Molecular graph generation
We examine the generative power of MGN and MGVAE in the challenging task of molecule generation, in which the
[Table]
graphs are highly structured. We demonstrate that MGVAE is the ﬁrst hierarchical graph VAE model generating graphs in a permutation-equivariant manner that is competitive against autoregressive results.
We train on two datasets that are standard in the ﬁeld:
QM9 (Ruddigkeit et al., 2012) (Ramakrishnan et al., 2014): contains 134 K organic molecules with up to nine atoms (C, H, O, N, and F) out of the GDBuniverse of molecules.
ZINC (Sterling & Irwin, 2015): contains 250 K purchasable drug-like chemical compounds with up to twenty-three heavy atoms.
We only use the graph features as the input, including the adjacency matrix, the one-hot vector of atom types ( e.g. carbon hydrogen
, etc.) and the bond types (single bond, double bond, etc.) without any further domain knowledge from chemistry or physics. First, we train autoencoding task of reconstructing the adjacency matrix and node features.
We use a learnable equivariant prior (see Sec.
C) instead of the conventional N( 0 , 1 ) .
Then, we generate 5 , 000 different samples from the prior, and decode each sample into a generated graph (see Fig. 3).
We implement our graph construction (decoding) in two approaches:
All-at-once : We reconstruct the whole adjacency matrix by running the probabilistic decoder (see Sec. 4).
MGVAE enables us to generate a graph at any given resolution level (cid:96) .
In this particular case, we select the highest resolution (cid:96) =
L .
This approach of decoding preserves equivariance, but is harder to train.
On ZINC, we extract several chemical/atomic features from RDKit as the input for the encoders to reach a good convergence in training.
Autoregressive : The graph is constructed iteratively by adding one edge in each iteration, similarly to (Liu et al., 2018).
But this approach does not respect permutation equivariance.
In our setting for small molecules, L = 3 and K = 2 (cid:96) − 1 for the (cid:96) -th level.
We compare our methods with other graphbased generative models including GraphVAE (Simonovsky & Komodakis, 2018), CGVAE (Liu et al., 2018), MolGAN (Cao & Kipf, 2018), and JT-VAE (Jin et al., 2018).
We evaluate the quality of generated molecules in three metrics: (i) validity, (ii) novelty and (iii) uniqueness as the percentage of the generated molecules that are chemically valid, different from all molecules in the training set, and not redundant, respectively.
Because of high complexity, we only train on a small random subset of examples while all other methods are trained on the full datasets.
Our models are equivalent with the state-of-the-art, even with a limited training set (see
Table 1).
Admittedly, molecule generation is a somewhat subject task that can only be evaluated with objective numerical measures up to a certain point.
Qualitatively, however the molecules that MGVAE generates are as good as the state of the art, in some cases better in terms of producing several high-quality drug-like molecules with complicated functional groups and structures.
Fig.
4 shows an example of interpolation on the latent space on ZINC with the all-atonce MGVAE.
Many further samples generated by MGVAE and their analysis can be found in the Appendix.
5.2. General graph generation by MGVAE
We further examine the expressive power of hierarchical latent structure of MGVAE in the task of general graph generation.
We choose two datasets from GraphRNN paper (You et al., 2018a):
Community-small : A synthetic dataset of 100 2community graphs where 12 ≤ ∣ V ∣ ≤ 20 . 2.
Ego-small : 200 3-hop ego networks extracted from the Citeseer network (Sen et al., 2008) where 4 ≤ ∣ V ∣ ≤ 18 .
The datasets are generated by the scripts from the
GraphRNN codebase (You et al., 2018b).
We keep 80% of the data for training and the rest for testing.
We evaluate our generated graphs by computing Maximum Mean
Discrepancy (MMD) distance between the distributions of graph statistics on the test set and the generated set as proposed by (You et al., 2018a).
The graph statistics are node degrees, clustering coefﬁcients, and orbit counts.
As suggested by (Liu et al., 2019), we execute 15 runs with different random seeds, and we generate 1,024 graphs for each run, then we average the results over 15 runs.
We compare
MGVAE against GraphVAE (Simonovsky & Komodakis, 2018), DeepGMG (Li et al., 2018), GraphRNN
(You et al., 2018a), GNF (Liu et al., 2019), and GraphAF
(Shi et al., 2020).
The baselines are taken from GNF paper (Liu et al., 2019) and GraphAF paper (Shi et al., 2020).
In our setting of (all-at-once) MGVAE, we implement only L = 2 levels of resolution and K = 2 (cid:96) clusters for each level.
Our encoders have 10 layers of message passing.
Instead of using a high order equivariant network as the global decoder for the bottom resolution, we only implement a simple fully connected network that maps the latent Z ( L ) ∈
R ∣V∣× d z into an adjacency matrix of size ∣V∣ × ∣V∣ .
For the ego dataset in particular, we implement the learnable equivariant prior as in
Sec.
B and Sec.
C. Table 2 includes our quantitative results in comparison with other methods.
MGVAE outperforms all competing methods.
Figs.
10 and 11 show some generated examples and training examples on the 2-community and ego datasets.
5.3. Supervised molecular properties prediction
To further demonstrate the comprehensiveness of MGN, we apply our model in a supervised regression task to predict the solubility (LogP) on the ZINC dataset.
We use the same split of 10K/1K/1K for training/validation/testing as in (Dwivedi et al., 2020).
The implementation of MGN is almost the same as detailed in Sec.
D.2, except we include the latents of all resolution levels into the prediction.
In particular, in each resolution level, we average all the node latents into a vector of size 256; then we concatentate all these vectors into a long vector of size 256 × L and apply a linear layer for the regression task.
The baseline results are taken from (Yang et al., 2020) including: Multilayer
Perceptron (MLP), Graph Convolution Networks (GCN),
Graph Attention Networks (GAT) (Velikovi et al., 2018),
MoNet (Monti et al., 2017), Disentangled Graph Convolutional Networks (DisenGCN) (Ma et al., 2019), Factorizable
Graph Convolutional Networks (FactorGCN) (Yang et al., 2020), GatedGCN E (Dwivedi et al., 2020) that uses additional edge information.
Our supervised result shows that
MGN outperforms the state-of-the-art models in the ﬁeld with a margin of 20% (see Table 3).
6. Conclusion
We introduced MGVAE built upon MGN, the ﬁrst generative model to learn and generate graphs in a multiresolution and equivariant manner.
The key idea of MGVAE is learning to construct a series of coarsened graphs along with a hierarchy of latent distributions in the encoding process while learning to decode each latent into the corresponding coarsened graph at every resolution level.
MGVAE achieves state-of-the-art results from link prediction to molecule and graph generation, suggesting that accounting for the multiscale structure of graphs is a promising way to make graph neural networks even more powerful.
A. Basic tensor operations
In order to build higher order equivariant networks, we revisit some basic tensor operations: tensor product (see Def. A.1) and tensor contraction (see Def.
A.2).
It can be shown that these tensor operations respect permutation equivariance.
Based on them, we build our second order message passing networks.
Deﬁnition A.1.
The tensor product of A ∈ R n a with B ∈ R n b yields a tensor C
=
A ⊗ B ∈ R n a + b where
[Equation]
Deﬁnition A.2.
The contraction of A ∈ R n a along the pair of dimensions { x,y } (assuming x < y ) yields a ( a − 2 ) -th order tensor
[Equation]
where we assume that i x
and i y have been removed from amongst the indices of C .
Using Einstein notation, this can be written more compactly as
[Equation]
where δ is the Kronecker delta.
In general, the contraction of A along dimensions { x 1 ,..,x p } yields a tensor C =
A ↓ x 1 ,..,x p ∈
R n a − p where
[Equation]
or compactly as
[Equation]
B. Markov Random Fields
Undirected graphical models have been widely applied in the domains spatial or relational data, such as image analysis and spatial statistics.
In general, k -th order graph encoders encode an undirected graph G =
(V , E) into a k -th order latent z ∈ R n k × d z , with learnable parameters θ , can be represented as a parameterized Markov Random Field (MRF) or Markov network.
Based on the Hammersley-Clifford theorem (Murphy, 2012) (Koller & Friedman, 2009), a positive distribution p ( z ) > 0 satisﬁes the conditional independent properties of an undirected graph G iff p can be represented as a product of potential functions ψ , one per maximal clique , i.e.,
[Equation]
where C is the set of all the (maximal) cliques of G , and Z ( θ ) is the partition function to ensure the overall distribution sums to 1, and given by
[Equation]
Eq.
9 can be further written down as
[Equation]
where ψ v , ψ st , and ψ c are the ﬁrst order, second order and k -th order outputs of the encoder, corresponding to every vertex in V , every edge in E and every clique of size k in C k , respectively.
However, factorizing a graph into set of maximal cliques has an exponential time complexity, since the problem of determining if there is a clique of size k in a graph is known as an
NP-complete problem.
Thus, the factorization based on Hammersley-Clifford theorem is intractable .
The second order encoder relaxes the restriction of maximal clique into edges , that is called as pairwise MRF:
[Equation]
Our second order encoder inherits Gaussian MRF introduced by (Rue & Held, 2005) as pairwise MRF of the following form
[Equation]
where ψ st ( z s ,z t ) = exp ( − 12 z s Λ st z t ) is the edge potential, and ψ t ( z t ) =
exp ( − 12 Λ tt z 2 t + η t z t ) is the vertex potental.
The joint distribution can be written in the information form of a multivariate Gaussian in which
[Equation]
Sampling z from p ( z ∣ θ ) in Eq.
10 is the same as sampling from the multivariate Gaussian N( µ , Σ ) .
To ensure end-to-end equivariance, we set the latent layer to be two tensors µ ∈ R n × d z and Σ ∈ R n × n × d z that corresponds to d z multivariate
Gaussians, whose ﬁrst index, and second index are ﬁrst order and second order equivariant with permutations.
Computation of Σ is trickier than µ , simply because Σ must be invertible to be a covariance matrix.
Thus, our second order encoder produces tensor L as the second order activation, and set Σ = LL T .
The reparameterization trick from Kingma & Welling (2014) is changed to
[Equation]
C. Equivariant learnable prior
The original VAE published by (Kingma & Welling, 2014) limits each covariance matrix Σ to be diagonal and the prior to be N( 0 , 1 ) .
Our second order encoder removes the diagonal restriction on the covariance matrix.
Furthermore, we allow the prior N( ˆ µ , ˆ Σ ) to be learnable in which ˆ µ and ˆ Σ are parameters optimized by back propagation in a data driven manner.
Importantly, ˆ Σ cannot be learned directly due to the invertibility restriction.
Instead, similarly to the second order encoder, a matrix ˆ L is optimized, and the prior covariance matrix is constructed by setting ˆΣ
=
ˆ L ˆ L T .
The Kullback-Leibler divergence between the two distributions N( µ , Σ ) and N( ˆ µ , ˆΣ ) is as follows:
[Equation]
[Equation]
Even though Σ is invertible, but gradient computation through the KL-divergence loss can be numerical instable because of
Cholesky decomposition procedure in matrix inversion.
Thus, we add neglectable noise (cid:15) =
10 − 4 to the diagonal of both covariance matrices.
Importantly, during training, the KL-divergence loss breaks the permutation equivariance.
Suppose the set of vertices are permuted by a permutation matrix P σ for σ ∈ S n .
Since µ and Σ are the ﬁrst order and second order equivariant outputs of the encoder, they are changed to P σ µ and P σ Σ P
Tσ accordingly.
But
[Equation]
To address the equivariance issue, we want to solve the following convex optimization problem that is our new equivariant loss function
[Equation]
[Equation]
However, solving the optimization based on Eq.
12 is computationally expensive.
One solution is to solve the minimum-cost maximum-matching in a bipartite graph (Hungarian matching) with the cost matrix C ij = ∣∣
µ i − ˆ µ j ∣∣ by O ( n 4 ) algorithm published by Edmonds & Karp (1972), that can be still improved further into O ( n 3 ) .
The Hungarian matching preserves equiariance, but is still computationally expensive.
In practice, instead of ﬁnding a optimal permutation, we apply a free-matching scheme to ﬁnd an assignment matrix Π such that: Π ij ∗ = 1 if and only if j ∗ =
arg min j ∣∣ µ i − ˆ µ j ∣∣ , for each i ∈ [ 1 ,n ] .
The free-matching scheme preserves equivariance and can be done efﬁciently in a simple O ( n 2 ) algorithm that is also suitable for GPU computation.
D. Experiments D.1. Link prediction on citation graphs
We demonstrate the ability of the MGVAE models to learn meaningful latent embeddings on a link prediction task on popular citation network datasets Cora and Citeseer (Sen et al., 2008).
At training time, 15% of the citation links (edges) were removed while all node features are kept, the models are trained on an incomplete graph Laplacian constructed from the remaining 85% of the edges.
From previously removed edges, we sample the same number of pairs of unconnected nodes (non-edges).
We form the validation and test sets that contain 5% and 10% of edges with an equal amount of non-edges, respectively.
We compare our model MGVAE against popular methods in the ﬁeld:
Spectral clustering (SC) (Tang & Liu, 2011) 2.
Deep walks (DW) (Perozzi et al., 2014) 3.
Variational graph autoencoder (VGAE) (Kipf & Welling, 2016)
on the ability to correctly classify edges and non-edges using two metrics: area under the ROC curve (AUC) and average precision (AP).
Numerical results of SC and DW are experimental settings are taken from (Kipf & Welling, 2016).
We reran the implementation of VGAE as in (Kipf & Welling, 2016).
For MGVAE, we initialize weights by Glorot initialization (Glorot & Bengio, 2010).
We repeat the experiments withdifferent random seeds and calculate the average AUC and AP along with their standard deviations.
The number of message passing layers ranges from 1 to 4.
The size of latent representation is 128.
The number of coarsening levels is L ∈ { 3 , 7 } .
In the (cid:96) -th coarsening level, we partition the graph G ( (cid:96) ) into 2 (cid:96) (for L = 7 ) or 4 (cid:96) (for L = 3 ) clusters.
We train for 2,048 epochs using Adam optimization (Kingma & Ba, 2015) with a starting learning rate of 0 . 01 .
Hyperparameters optimization (e.g. number of layers, dimension of the latent representation, etc.) is done on the validation set.
MGVAE outperforms all other methods (see Table 4).
We propose our learning to cluster algorithm to achieve the balanced K -cut at every resolution level.
Besides, we also implement two ﬁxed clustering algorithms:
Spectral : It is similar to the one implemented in (Rustamov & Guibas, 2013).
• First, we embed each node i ∈ V into R n max as ( ξ 1 ( i )/
λ 1 ( i ) ,..,ξ n max ( i )/ λ n max ( i )) , where { λ n ,ξ n } n max n = 0 are the eigen-pairs of the graph Laplacian L
= D − 1 (D − A) where D ii =
∑ j A ij .
We assume that λ 0 ≤ .. ≤ λ n max .
In this case, n max = 10 .
• At the (cid:96) -th resolution level, we apply the K-Means clustering algorithm based on the above node embedding to partition graph G ( (cid:96) ) .
K-Means : • First, we apply PCA to compress the sparse word frequency vectors (of size 1,433 on Cora and 3,703 on Citeseer) associating with each node into 10 dimensions.
• We use the compressed node embedding for the K-Means clustering.
Tables 5 and 6 show that our learning to cluster algorithm returns a much more balanced cut on the highest resolution level comparing to both Spectral and K-Means clusterings.
For instance, we have L = 7 resolution levels and we partition the (cid:96) -th resolution into K = 2 (cid:96) clusters.
Thus, on the bottom levels, we have 128 clusters.
If we distribute nodes into clusters uniformly, the expected number of nodes in a cluster is 21 .
15 and 25 .
99 on Cora ( 2 , 708 nodes) and Citeseer ( 3 , 327 nodes), respectively.
We measure the minimum, maximum, standard deviation of the numbers of nodes in 128 clusters.
Furthermore, we measure the Kullback–Leibler divergence between the distribution of nodes into clusters and the uniform distribution.
Our learning to cluster algorithm achieves low KL losses of 0 .
02 and 0 .
01 on Cora and Citeseer, respectively.
[Table] [Table]
[Table]
D.2. Molecular graph generation
In this case, MGVAE and MGN are implemented with L = 3 resolution levels, and the (cid:96) -th resolution graph is partitioned into K = 2 (cid:96) − 1 clusters.
On each resolution level, the local encoders and local decoders are second-order S n -equivariant networks with up to 4 equivariant layers.
The number of channels for each node latent d z is set to 256.
We apply two approaches for graph decoding: 1.
All-at-once : MGVAE reconstructs all resolution adjacencies by equivariant decoder networks.
Furthermore, we apply learnable equivariant prior as in Sec.
C. Our second order encoders are interpreted as Markov Random Fields (see
Sec. B).
This approach preserves permutation equivariance.
In addition, we implement a correcting process: the decoder network of the highest resolution level returns a probability for each edge, we sort these probabilities in a descending order and gradually add the edges in that order to satisfy all chemical constraints.
Furthermore, we investigate the expressive power of the second order S n -equivariant decoder by replacing it by a multilayer perceptron (MLP) decoder with 2 hidden layers of size 512 and sigmoid nonlinearity.
We ﬁnd that the higher order decoder outperforms the MLP decoder given the same encoding architecture.
Table 7 shows the comparison between the two decoding models.
Autoregressive : This decoding process is constructed in an autoregressive manner similarly to (Liu et al., 2018).
First, we sample each vertex latent z independently.
We randomly select a starting node v 0 , then we apply Breath First Search (BFS) to determine a particular node ordering from the node v 0 , however that breaks the permutation equivariance.
Then iteratively we add/sample new edge to the existing graph G t at the t -th iteration (given a randomly selected node v 0 as the start graph G 0 ) until completion.
We apply second-order MGN with gated recurrent architecture to produce the probability of edge ( u,v ) where one vertex u is in the existing graph G t and the another one is outside; and also the probability of its label.
Intuitively, the decoding process is a sequential classiﬁcation.
We randomly select 10,000 training examples for QM9; and 1,000 (autoregressive) and 10,000 (all-at-once) training examples for ZINC.
It is important to note that our training sets are much smaller comparing to other methods.
For all of our generation experiments, we only use graph features as the input for the encoder such as one-hot atomic types and bond types.
Since ZINC molecules are larger then QM9 ones, it is more difﬁcult to train with the second order
S n -equivariant decoders (e.g., the number of bond/non-bond predictions or the number of entries in the adjacency matrices are proportional to squared number of nodes).
Therefore, we input several chemical/atomic features computed from RDKit for the all-at-once
MGVAE on ZINC (see Table 8).
We concatenate all these features into a vector of size 24 for each atom.
We train our models with Adam optimization method (Kingma & Ba, 2015) with the initial learning rate of 10 − 3 .
Figs.and 6 show some selected examples out of 5,000 generated molecules on QM9 by all-at-once MGVAE, while Fig.
7 shows the molecules generated by autoregressive MGN.
Qualitatively, both the decoding approaches capture similar molecular substructures (bond structures).
Fig.
8 shows some generated molecules on ZINC by the all-at-once MGVAE.
Fig.
9 and table 9 show some generated molecules by the autoregressive MGN on ZINC dataset with high Quantitative Estimate of
Drug-Likeness (QED) computed by RDKit and their SMILES strings.
On ZINC, the average QED score of the generated molecules is 0 .
45 with standard deviation 0 .
On QM9, the QED score is 0 .
44 ± 0 .
[Table] [Table]
[Equation]
[Equation] [Equation]
[Table]
D.3. General graph generation by MGVAE
Figs.
10 and 11 show some generated examples and training examples on the 2-community and ego datasets, respectively.
D.4. Unsupervised molecular properties prediction on QM
Density Function Theory (DFT) is the most successful and widely used approach of modern quantum chemistry to compute the electronic structure of matter, and to calculate many properties of molecular systems with high accuracy (Hohenberg &
Kohn, 1964).
However, DFT is computationally expensive (Gilmer et al., 2017), that leads to the use of machine learning to estimate the properties of compounds from their chemical structure rather than computing them explicitly with DFT (Hy et al., 2018).
To demonstrate that MGVAE can learn a useful molecular representations and capture important molecular structures in an unsupervised and variational autoencoding manner, we extract the highest resolution latents (at (cid:96) = L ) and use them as the molecular representations for the downstream tasks of predicting DFT’s molecular properties on QM including 13 learning targets.
For the training, we normalize all learning targets to have mean 0 and standard deviation 1.
The name, physical unit, and statistics of these learning targets are detailed in Table 10.
The implementation of MGVAE is the same as detailed in Sec.
D.2.
MGVAE is trained to reconstruct the highest resolution (input) adjacency, its coarsening adjacencies and the node atomic features.
In this case, we do not use any chemical features:
[Figure]
[Table] [Table]
the node atomic features are just one-hot atomic types.
After MGVAE is converged, to obtain the S n -invariant molecular representation, we average the node latents at the L -th level into a vector of size 256.
Finally, we apply a simple Multilayer
Perceptron with 2 hidden layers of size 512, sigmoid nonlinearity and a linear layer on top to predict the molecular properties based on the extracted molecular representation.
We compare the results in Mean Average Error (MAE) in the corresponding physical units with four methods on the same split of training and testing from (Hy et al., 2018):
Support Vector Machine on optimal-assignment Weisfeiler-Lehman (WL) graph kernel
(Shervashidze et al., 2011) (Kriege et al., 2016) 2.
Neural Graph Fingerprint (NGF) (Duvenaud et al., 2015) 3.
PATCHY-SAN (PSCN)
(Niepert et al., 2016) 4.
Second order S n -equivariant Covariant Compositional Networks (CCN 2D) (Kondor et al., 2018)
(Hy et al., 2018)
Our unsupervised results show that MGVAE is able to learn a universal molecular representation in an unsupervised manner and outperforms WL in 12, NGF in 10, PSCN in 8, and CCN 2D in 8 out of 13 learning targets, respectively (see Table 11).
There are other recent methods in the ﬁeld that use several chemical and geometric information but comparing to them would be unfair.
D.5. Graph-based image generation by MGVAE
In this additional experiment, we apply MGVAE into the task of image generation.
Instead of matrix representation, an image I ∈
R H
× W is represented by a grid graph of H ⋅ W nodes in which each node represents a pixel, each edge is between two neighboring pixels, and each node feature is the corresponding pixel’s color (e.g., R 1 in gray scale, and R 3 in RGB scale).
Fig.
12 demonstrates an exmaple of graph representation for images.
Since images have natural spatial clustering, instead of learning to cluster, we implement a ﬁxed clustering procedure as follows:
[Table]
[Figure] [Figure]
Target
Reconstruction
• For the (cid:96) -th resolution level, we divide the grid graph of size H ( (cid:96) )
× W ( (cid:96) ) into clusters of size
h × w that results into a grid graph of size H ( (cid:96) )
h × W ( (cid:96) ) w , supposingly h and w are divisible by H ( (cid:96) ) and W ( (cid:96) ) , respectively.
Each resolution is associated with an image
I ( (cid:96) ) that is a zoomed out version of I ( (cid:96) + 1 ) .
• The global encoder e
(cid:96) ) is implemented with 10 layers of message passing that operates on the whole H ( (cid:96) )
× W ( (cid:96) ) grid graph.
We sum up all the node latents into a single latent vector Z ( (cid:96) )
∈ R d z .
The global decoder d ( (cid:96) ) is implemented by the convolutional neural network architecture of the generator of DCGAN model (Radford et al., 2016) to map Z ( (cid:96) ) into an approximated image
ˆ I ( (cid:96) ) .
The S n -invariant pooler p ( (cid:96) ) is a network operating on each small h × w grid graph to produce the corresponding node feature for the next level (cid:96) + 1 .
MGVAE is trained to reconstruct all resolution images.
Fig.
13 shows an example of reconstruction at each resolution on a test image of MNIST (after the network converged).
We evaluate our MGVAE architecture on the MNIST dataset (LeCun et al., 1999) with 60,000 training examples and 10,000 testing examples.
The original image size is 28 × 28 .
We pad zero pixels to get the image size of 2 5 × 2 5 (e.g.,
H ( 5 ) =
W ( 5 ) = 32 ).
Each cluster is a small grid graph of size 2 × 2 (e.g., h = w = 2 ).
Accordingly, the image sizes for all resolutions are 32 × 32 , 16 × 16 , 8 × 8 , etc.
In this case, the whole network architecture is a 2-dimensional quadtree.
The latent size d z is selected as 256.
We train our model for 256 epochs by Adam optimizer (Kingma & Ba, 2015) with the initial learning rate 10 − 3 .
In the testing process, for the (cid:96) -th resolution, we sample a random vector of size d z from prior N( 0 , 1 ) and use the decoder d ( (cid:96) ) to decode the corresponding image.
We generate 10,000 examples for each resolution.
We compute the Frechet Inception Distance (FID) proposed by (Heusel et al., 2017) between the testing set and the generated set as the metric to evaluate the quality of our generated examples.
We use the FID implementation from (Seitzer, 2020).
We compare our MGVAE against variants of Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) including DCGAN (Radford et al., 2016), VEEGAN (Srivastava et al., 2017), PacGAN (Lin et al., 2018), and PresGAN (Dieng et al., 2019).
Table 12 shows our quantitative results in comparison with other competing generative models.
The baseline results are taken from Prescribed Generative Adversarial Networks paper (Dieng et al., 2019).
MGVAE outperforms all the baselines for the highest resolution generation.
Figs.
14 and 15 show some generated examples of the 32 × 32 and 16 × 16 resolution, respectively.