M EMORY -B ASED G RAPH N ETWORKS
A BSTRACT
Graph neural networks (GNNs) are a class of deep models that operate on data with arbitrary topology represented as graphs
We introduce an efﬁcient memory layer for GNNs that can jointly learn node representations and coarsen the graph.
We also introduce two new networks based on this layer: memory-based
GNN (MemGNN) and graph memory network (GMN) that can learn hierarchical graph representations.
The experimental results shows that the proposed models achieve state-of-the-art results in eight out of nine graph classiﬁcation and regression benchmarks.
We also show that the learned representations could correspond to chemical features in the molecule data.
Code and reference implementations are released at: https://github.com/amirkhas/GraphMemoryNet
I NTRODUCTION
Graph neural networks (GNNs) (Wu et al., 2019; Zhou et al., 2018; Zhang et al., 2018) are a class of deep models that operate on data with arbitrary topology represented as graphs such as social networks (Kipf & Welling, 2016), knowledge graphs (Vivona & Hassani, 2019), molecules (Duvenaud et al., 2015), point clouds (Hassani & Haley, 2019), and robots (Wang et al., 2019).
Unlike regular-structured inputs with spatial locality such as grids (e.g., images and volumetric data) and sequences (e.g., speech and text), GNN inputs are permutation-invariant variable-size graphs consisting of nodes and their interactions.
GNNs such as gated GNN (GGNN) (Li et al., 2015), message passing neural network (MPNN) (Gilmer et al., 2017), graph convolutional network (GCN) (Kipf &
Welling, 2016), and graph attention network (GAT) (Velikovi et al., 2018) learn node representations through an iterative process of transferring, transforming, and aggregating the node representations from topological neighbors.
Each iteration expands the receptive ﬁeld by one hop and after k iterations the nodes within k hops inﬂuence the node representations of one another.
GNNs are shown to learn better representations compared to random walks (Grover & Leskovec, 2016;
Perozzi et al., 2014), matrix factorization (Belkin & Niyogi, 2002;
Ou et al., 2016), kernel methods (Shervashidze et al., 2011; Kriege et al., 2016), and probabilistic graphical models (Dai et al., 2016).
These models, however, cannot learn hierarchical representations as they do not exploit the compositional nature of graphs.
Recent work such as differentiable pooling (DiffPool)
(Ying et al., 2018),
TopKPool (Gao & Ji, 2019), and self-attention graph pooling (SAGPool) (Lee et al., 2019) introduce parametric graph pooling layers that allow GNNs learn hierarchical graph representations by stacking interleaved layers of GNN and pooling layers.
These layers cluster nodes in the latent space such that the clusters are meaningful with respect to the task.
These clusters might be communities in a social network or potent functional groups within a chemical dataset.
Nevertheless, these models are not efﬁcient as they require an iterative process of message passing after each pooling layer.
In this paper, we introduce a memory layer for joint graph representation learning and graph coarsening that consists of a multi-head array of memory keys and a convolution operator to aggregate the soft cluster assignments from different heads.
The queries to a memory layer are node representations from the previous layer and the outputs are the node representations of the coarsened graph.
The memory layer does not explicitly require connectivity information and unlike GNNs relies on the global information rather than local topology.
Hence, it does not struggle with over-smoothing problem (Xu et al., 2018; Li et al., 2018).
These properties make memory layers more efﬁcient with improved performance.
We also introduce two networks based on the proposed layer: memorybased GNN (MemGNN) and graph memory network (GMN).
MemGNN consists of a GNN that learns the initial node representations, and a stack of memory layers that learn hierarchical graph representations up to the global graph representation.
GMN, on the other hand, learns the hierarchical representations purely based on memory layers and hence does not require message passing.
R ELATED W ORK
Memory augmented neural networks (MANNs) utilize external memory with differentiable readwrite operators allowing them to explicitly access the past experiences and are shown to enhance reinforcement learning (Pritzel et al., 2017), meta learning (Santoro et al., 2016), few-shot learning (Vinyals et al., 2016), and multi-hop reasoning (Weston et al., 2015).
Unlike RNNs, in which the memory is represented within their hidden states, the decoupled memory in MANNs allows them to store and retrieve longer term memories with less parameters.
The memory can be implemented as: key-value memory such as neural episodic control (Pritzel et al., 2017), product-key memory layers (Lample et al., 2019), or array-structured memory such as neural Turing machine (NTM) (Graves et al., 2014), prototypical networks (Snell et al., 2017), memory networks (Weston et al., 2015), and sparse access memory (SAM) (Rae et al., 2016).
Our memory layer consists of a multi-head array of memory keys.
Graph neural networks (GNNs) mostly use message passing to learn node representations over graphs.
GraphSAGE (Hamilton et al., 2017b) learns representations by sampling and aggregating neighbor nodes whereas GAT (Velikovi et al., 2018) uses attention mechanism to aggregate representations from all neighbors.
GCN extend the convolution operator to arbitrary topology.
Spectral
GCNs (Bruna et al., 2014; Defferrard et al., 2016; Kipf & Welling, 2016) use spectral ﬁlters over graph Laplacian to deﬁne the convolution in the Fourier domain.
These models are less efﬁcient compared to spatial GCNs (Schlichtkrull et al., 2018; Ma et al., 2019) which directly deﬁne the convolution on graph patches centered on nodes.
Our memory layer uses a feed-forward network to learn the node embeddings.
Graph pooling can be deﬁned in global or hierarchical manners.
In former, node representations are aggregated into a graph representation by a readout layer implemented using arithmetic operators such as summation or averaging (Hamilton et al., 2017a; Kipf & Welling, 2016) or set neural networks such as Set2Set (Vinyals et al., 2015) and SortPool (Morris et al., 2019).
In latter, graphs are coarsened in each layer to capture the hierarchical structure.
Efﬁcient non-parametric methods such as clique pooling (Luzhnica et al., 2019), kNN pooling (Wang et al., 2018), and Graclus (Dhillon et al., 2007) rely on topological information, but are outperformed by parametric models such as edge contraction pooling (Diehl, 2019).
DiffPool (Ying et al., 2018) trains two parallel GNNs to compute node representations and cluster assignments using a multi-term loss including classiﬁcation, link prediction, and entropy losses, whereas Mincut pool (Bianchi et al., 2019) trains a sequence of a GNN and an MLP using classiﬁcation loss and the minimum cut objective.
TopKPool (Cangea et al., 2018; Gao & Ji, 2019) computes node scores by learning projection vectors and dropping all the nodes except the top scoring nodes.
SAGPool (Lee et al., 2019) extends the TopKPool by using graph convolutions to take neighbor node features into account.
We use a clustering-friendly distribution to compute the attention scores between nodes and clusters.
M ETHOD
M EMORY L AYER
We deﬁne a memory layer M ( l ) :
R n l × d l (cid:55)−→ R n l +1 ×
d l +1 in layer l as a parametric function that takes in n l query vectors of size d l and generates n l +1 query vectors of size d l +1 such that n l +1 < n l .
The input and output queries represent the node features of the input graph and the coarsened graph, respectively.
The memory layer learns to jointly coarsen the input nodes, i.e., pooling, and transform their features, i.e., representation learning.
As shown in Figure 1, a memory layer consists
[Figure]
of arrays of memory keys, i.e., multi-head memory, and a convolutional layer.
Assuming | h | memory heads, a shared input query is compared against all the keys in each head resulting in | h | attention matrices which are then aggregated into a single attention matrix using the convolution layer.
In a content addressable memory (Graves et al., 2014; Sukhbaatar et al., 2015; Weston et al., 2015), the task of attending to memory, i.e., addressing scheme, is formulated as computing the similarity between memory keys to a given query q .
Speciﬁcally, the attention weight of key k j for query q is deﬁned as w j = softmax ( d ( q, k j )) where d is a similarity measure, typically Euclidean distance or cosine similarity (Rae et al., 2016).
The soft read operation on memory is deﬁned as a weighted average over the memory keys: r = (cid:80) j w j k j .
In this work, we treat the input queries Q ( l ) ∈ R n l × d l as the node representations of an input graph and treat the keys K ( l ) ∈ R n l +1 ×
d l as the cluster centroids of the queries.
To satisfy this assumption, we impose a clustering-friendly distribution as the distance metric between keys and a query.
Following (Xie et al., 2016; Maaten & Hinton, 2008), we use the Student’s t-distribution as a kernel to measure the normalized similarity between query q i and key k j as follows:
[Equation]
where C ij is the normalized score between query q i and key k j , i.e., probability of assigning node i to cluster j or attention score between query q i and memory key k j , and τ is the degree of freedom of the Student’s t-distribution, i.e., temperature.
To increase the capacity, we model the memory keys as a multi-head array.
Applying a shared input query against the memory keys produces a tensor of cluster assignments [ C ( l ) 0 ...
C ( l ) | h | ] ∈ R | h |× n l +1 × n l where | h | denotes the number of heads.
To aggregate the heads into a single assignment matrix, we treat the heads and the assignments matrices as depth, height, and width channels in standard convolution analogy and apply a convolution operator over them.
Because there is no spatial structure, we use [1 × 1] convolution to aggregate the information across heads and therefore the convolution behaves as a weighted pooling that reduces the heads to a single matrix.
The aggregated assignment matrix is computed as follows:
[Equation]
where Γ φ is a [1 × 1] convolutional operator parametrized by φ , || is the concatenation operator, and
C ( l ) is the aggregated soft assignment matrix.
A memory read generates a value matrix V ( l ) ∈ R n l +1 ×
d l that represents the coarsened node representations in the same space as the input queries and is deﬁned as the product of the soft assignment scores and the original queries as follows:
[Equation]
The value matrix is fed to a single-layer feed-forward neural network to project the coarsened embeddings from R n l +1 ×
d l into R n l +1 ×
d l +1 as follows:
[Equation]
where Q ( l +1) ∈
R n l +1 ×
d l +1 is output queries,
W ∈ R d
l × d l +1 is network parameters, and σ is the non-linearity implemented using LeakyReLU.
Thanks to these parametrized transformations, a memory layer can jointly learn the node representations and coarsens the graph end-to-end.
The computed queries Q ( l +1) are the input queries to the subsequent memory layer M ( l +1) .
For graph classiﬁcation tasks, one can simply stack layers of memory up to the level where the input graph is coarsened into a single node representing the global graph representation and then feed it to a fully-connected layer to predict the graph class as follows:
[Equation]
where Q 0 = f q ( g ) is the initial query representation 1 generated by the query network f q over graph g .
We introduce two architectures based on the memory layer: GMN and MemGNN.
These two architectures are different in the way that the query network is implemented.
More speciﬁcally,
GMN uses a feed-forward network for initializing the query:
f q ( g ) =
FFN θ ( g ) , whereas MemGNN implements the query network as a message passing GNN: f q ( g ) =
GNN θ ( g ) .
3. GMN A RCHITECTURE
A GMN is a stack of memory layers on top of a query network f q ( g ) that generates the initial query representations without any message passing.
Similar to set neural networks (Vinyals et al., 2015) and transformers (Vaswani et al., 2017), nodes are treated as a permutation-invariant set of representations.
The query network projects the initial node features into a latent space that represents the initial query space.
Assume a training set D =
[ g 1 , g 2 , ..., g N ] of N graphs where each graph is represented as g =
( A , X , Y ) and A ∈ { 0 , 1 } n × n denotes the adjacency matrix, X ∈ R n × d in is the initial node features, and Y ∈ R n is the graph label.
Considering that GMN treats a graph as a set of order-invariant nodes and does not use message passing, and also considering that the memory layers do not rely on connectivity information, the topological information of each node should be somehow encoded into its initial representation.
To deﬁne the topological embedding, we use an instantiation of general graph diffusion matrix S ∈ R n × n .
More speciﬁcally, we use random walk with restart (RWR)
(Pan et al., 2004) to compute the topological embeddings and then sort them row-wise to force the embedding to be order-invariant.
For further details please see section A.4.
Inspired by transformers (Vaswani et al., 2017), we then fuse the topological embeddings with the initial node features into the initial query representations using a query network f q implemented as a two-layer feed-forward neural network:
[Equation]
6) where W 0 ∈ R n × d in and W
3.2. P ERMUTATION I NVARIANCE
Considering the inherent permutation-invariant nature of graph-structured data, a model designed to address graph classiﬁcation tasks, should also enforce this property.
This implies that the model should generate same outputs for isomorphic input graphs.
We impose this on GMN architecture by sorting the topological embedding row-wise as a pre-processing step.
Proposition 1.
Given a sorting function o, GMN ( o ( S ) , X ) is permutation invariant.
Proof.
Let P ∈ { 0 , 1 } { n × n } be an arbitrary permutation matrix.
For each node in graph G with adjacency matrix A , the corresponding node in graph G P with permuted adjacency matrix PAP T has the permuted version of the topological embedding of the node in graph G .
Sorting the embeddings cancels out the effect of permutation and makes the corresponding embeddings in graph G and G P identical.
3. M EM GNN A RCHITECTURE
Unlike the GMN architecture, the query network in MemGNN relies on the process of passing messages and aggregating them to compute the initial query Q 0 :
[Equation]
where query network G θ is an arbitrary parameterized message passing GNN (Gilmer et al., 2017;
Li et al., 2015; Kipf & Welling, 2016; Velikovi et al., 2018).
In our implementation, we use a modiﬁed variant of GAT (Velikovi et al., 2018).
Speciﬁcally, we introduce an extension to the original GAT model called edge-based GAT ( e-GAT ) and use it as the query network.
Unlike GAT, e-GAT learns attention weights not only from the neighbor nodes but also from the input edge features.
This is especially important for data containing edge information (e.g., various bonds among atoms represented as edges in molecule datasets).
In an e-GAT layer, attention score between two neighbor nodes is computed as follows:
[Equation]
where h ( l ) i and h ( l ) i → j denote the embedding of node i and the embedding of the edge connecting node i to its one-hop neighbor node j in layer l , respectively.
W n and W e are learnable node and edge weights and W is the parameter of a single-layer feed-forward network that computes the attention score.
σ is the non-linearity implemented using LeakyReLU.
3. T RAINING
We jointly train the model using two loss functions: a supervised loss and an unsupervised clustering loss.
The supervised loss denoted as L sup is deﬁned as cross-entropy loss and root mean square error (RMSE) for graph classiﬁcation and regression tasks, respectively.
The unsupervised clustering loss is inspired by deep clustering methods (Razavi et al., 2019;
Xie et al., 2016; Aljalbout et al., 2018).
It encourages the model to learn clustering-friendly embeddings in the latent space by urging it to learn from high conﬁdence assignments with the help of an auxiliary target distribution.
The unsupervised loss is deﬁned as the Kullback-Leibler (KL) divergence between the soft assignments C ( l ) and the auxiliary distribution P ( l ) as follows:
[Equation]
For the target distributions P ( l ) , we use the distribution proposed in (Xie et al., 2016) which normalizes the loss contributions and improves the cluster purity while emphasizing on the samples with higher conﬁdence.
This distribution is deﬁned as follows:
[Equation]
We deﬁne the total loss as follows where L is the number of memory layers and λ is a scalar weight.
[Equation]
We initialize the model parameters, the keys, and the queries randomly and optimize them jointly with respect to L using mini-batch stochastic gradient descent.
To stabilize the training, the gradients of L sup are back-propagated batch-wise while the gradients of L ( l ) KL are applied epoch-wise by periodically switching λ between 0 and 1 .
Updating the centroids, i.e., memory keys, with the same frequency as the network parameters can destabilize the training.
To address this, we optimize all model parameters and the queries in each batch with respect to L sup and in each epoch with respect to L ( l ) KL .
Memory keys, on the other hand, are only updated at the end of each epoch by the gradients of L ( l ) KL .
This technique has also been applied in (Hassani & Haley, 2019; Caron et al., 2018) to avoid trivial solutions.
E XPERIMENTS 4. D ATASETS
We use nine benchmarks including seven graph classiﬁcation and two graph regression datasets to evaluate the proposed method.
These datasets are commonly used in both graph kernel (Borgwardt & Kriegel, 2005; Yanardag & Vishwanathan, 2015; Shervashidze et al., 2009;
Ying et al., 2018;
Shervashidze et al., 2011; Kriege et al., 2016) and GNN (Cangea et al., 2018;
Ying et al., 2018; Lee et al., 2019; Gao & Ji, 2019) literature.
The summary of the datasets is as follows where the ﬁrst two benchmarks are regression tasks and the rest are classiﬁcation tasks.
ESOL (Delaney, 2004) contains water solubility data for compounds.
Lipophilicity (Gaulton et al., 2016) contains experimental results of octanol/water distribution of compounds.
Bace (Subramanian et al., 2016) provides quantitative binding results for a set of inhibitors of human β -secretase 1 (BACE-1).
DD (Dobson & Doig, 2003) is used to distinguish enzyme structures from non-enzymes.
Enzymes (Schomburg et al., 2004) is for predicting functional classes of enzymes.
Proteins (Dobson & Doig, 2003) is used to predict the protein function from structure.
Collab (Yanardag & Vishwanathan, 2015) is for predicting the ﬁeld of a researcher given one’s egocollaboration graph.
Reddit-Binary (Yanardag & Vishwanathan, 2015) is for predicting the type of community given a graph of online discussion threads.
Tox21 (Challenge, 2014) is for predicting toxicity on 12 different targets.
For more information about the detailed statistics of the datasets refer to Appendix A.2.
4. G RAPH C LASSIFICATION R ESULTS
To evaluate the performance of our models on DD, Enzymes, Proteins, Collab, and Reddit-Binary datasets, we follow the experimental protocol in (Ying et al., 2018) and perform 10-fold crossvalidation and report the mean accuracy over all folds.
We also report the performance of four graph kernel methods including Graphlet (Shervashidze et al., 2009), shortest path (Borgwardt & Kriegel,
[Table] [Table]
, Weisfeiler-Lehman (WL) (Shervashidze et al., 2011), and WL Optimal Assignment (Kriege et al., 2016), and ten GNN models.
The results shown in Table 1 suggest that: ( i ) our models achieve state-of-the-art results w.r.t.
GNN models and signiﬁcantly improve the performance on Enzymes, Proteins, DD, Collab, and RedditBinary datasets by absolute margins of 14.49%, 6.0%, 3.76%, 2.62%, and 8.98% accuracy, respectively, ( ii ) our models outperform graph kernels on all datasets except Collab where our models are competitive with the best kernel, i.e., small absolute margin of 0.56%, ( iii ) both proposed models achieve better performance or are competitive compared to the baseline GNNs, ( iv ) GMN achieves better results compared to MemGNN which suggest that replacing local adjacency information with global topological embeddings provides the model with more useful information, and ( v ) On Collab, our models are outperformed by a variant of DiffPpool (i.e., diffpool-det)
(Ying et al., 2018) and WL
Optimal Assignment (Kriege et al., 2016).
The former is a GNN augmented with deterministic clustering algorithm 2 , whereas the latter is a graph kernel method.
We speculate this is because of the high edge-to-node ratio in this dataset and these augmentations help extracting near-optimal cliques.
To evaluate the performance on BACE and Tox21 datasets, we follow the evaluation protocol in (Wu et al., 2018) and report the area under the curve receiver operating characteristics (AUC-ROC) measure.
Considering that the BACE and Tox21 datasets contain initial edge features, we train the
[Table]
MemGNN model and compare its performance to the baselines reported in (Wu et al., 2018).
The results shown in Table 2 suggest that our model achieves state-of-the-art results by absolute margin of 4.0 AUC-ROC on BACE benchmark and is competitive with the state-of-the-art GCN model on the Tox21 dataset, i.e., absolute margin of 0.001.
[Table]
R EGRESSION R ESULTS
For the ESOL and Lipophilicity datasets, we follow the evaluation protocol in (Wu et al., 2018) and report their RMSEs.
Considering that these datasets contain initial edge features (refer to Appendix
A.2 for further details), we train the MemGNN model and compare the results to the baseline models reported in (Wu et al., 2018) including graph based methods such as GCN, MPNN, directed acyclic graph (DAG) model, and Weave as well as other conventional methods such as kernel ridge regression (KRR) and inﬂuence relevance voting (IRV).
Results shown in Table 3 suggest that
our
MemGNN model achieves state-of-the-art results by absolute margin of 0.07 and 0.1 RMSE on
ESOL and Lipophilicity benchmarks, respectively.
For further details on regression datasets and baselines refer to (Wu et al., 2018).
4. A BLATION S TUDY 4.4. E FFECT OF EDGE FEATURES
To investigate the effect of the proposed e-GAT model, we train the MemGNN model using both
GAT and e-GAT models as the query network.
Considering that the ESOL, Lipophilicity, and BACE datasets contain edge features, we use them as the benchmarks.
Since nodes have richer features compared to edges, we set the node and edge feature dimensions to 16 and 4, respectively.
The comparative performance evaluation of the two models on the ESOL dataset is shown in AppendixA. suggesting that e-GAT achieves better results on the validation set in each epoch compared to the standard GAT model.
We observed the same effect on Lipophilicity and BACE datasets too.
4.4. E FFECT OF T OPOLOGICAL E MBEDDING
To investigate the effect of topological embeddings on the GMN model, we evaluated three initial topological features including adjacency matrix, normalized adjacency matrix, and RWR.
For further details on RWR, see section A.4.
The results suggested that using the RWR as the initial positional embedding achieves the best performance.
For instance, 10-fold cross validation accuracy of a GMN model trained on Enzymes dataset with adjacency matrix, normalized adjacency matrix, and RWR are 78.66%, 77.16%, and 77.33%, respectively.
Furthermore, sorting the topological embeddings sorting to guarantee invariance to permutations improves the performance.
For example, it increases the accuracy on the DD dataset from 82.24% to 84.40%.
[Figure]
4.4. D OWN - SAMPLING N EIGHBORS WITH R ANDOM W ALKS
We investigated two methods to down-sample the neighbors in dense datasets such as Collab (i.e., average of 66 neighbors per node) to enhance the memory and computation.
The ﬁrst method randomly selects 10% of the edges whereas the second method ranks the neighbors based on their
RWR scores with respect to the center node and then keeps the top 10% of the edges.
We trained the MemGNN model on Collab using both sampling methods which resulted in 73.9% and 73.1% 10-fold cross validation accuracy for random and RWR-based sampling methods respectively, suggesting that random sampling performs slightly better than a random walk sampling.
4.4. E FFECT OF N UMBER OF K EYS AND H EADS
We speculate that although keys represent the clusters, the number of keys is not necessarily proportional to the number of the nodes in the input graphs.
In fact, datasets with smaller graphs might have more meaningful clusters to capture.
For example, molecules are comprised of numerous functional groups and yet the average number of nodes in the ESOL dataset is 13.3.
Moreover, our experiments show that for ENZYMES with average number of 32.69 nodes, the best performance is achieved with 10 keys whereas for the ESOL dataset 64 keys results in the best performance.
In
ESOL 8, 64, and 160 keys result in RMSE of 0.56, 0.52, and 0.54, respectively.
We also observed that with a ﬁxed number of parameters, increasing the number of memory heads improves the performance.
For instance, when the model is trained on ESOL with 160 keys and 1 head, it achieves
RMSE of 0.54, whereas when trained with 32 keys and 5 heads, the same model achieves RMSE of 0.53.
4.4. W HAT D O THE K EYS R EPRESENT ?
Intuitively, the memory keys represent the cluster centroids and enhance the model performance by capturing meaningful structures.
To investigate this, we used the learned keys to interpret the knowledge learned by models through visualizations.
Figure 2 visualizes the learned clusters over atoms (i.e., atoms with the same color are within the same cluster) indicating that the clusters mainly consist of meaningful chemical substructures such as a carbon chain and a Hydroxyl group (OH) (i.e., Figure 2a), as well as a Carboxyl group (COOH) and a benzene ring (i.e., Figure 2b).
From a chemical perspective, Hydroxyl and Carboxyl groups, and carbon chains have a signiﬁcant impact on the solubility of the molecule in water or lipid.
This conﬁrms that the network has learned chemical features that are essential for determining the molecule solubility.
It is noteworthy that we tried initializing the memory keys using K-Means algorithm over the initial node representations to warm-start them
but we did not observe any signiﬁcant improvement over the randomly selected keys.
C ONCLUSION
We proposed an efﬁcient memory layer and two deep models for hierarchical graph representation learning.
We evaluated the proposed models on nine graph classiﬁcation and regression tasks and achieved state-of-the-art results on eight of them.
We also experimentally showed that the learned representations can capture well-known chemical features of the molecules.
Furthermore, we showed that concatenating node features with topological embeddings and passing them through a few memory layers achieves notable results without using message passing.
We also showed deﬁning the topological embeddings using graph diffusion achieves best performance.
Finally, we showed that although connectivity information is not explicitly imposed on the model, the memory layer can process node representations and properly cluster and aggregate the learned representations.
Limitations :
In section 4.3, we discussed that on the Collab dataset, a graph kernel and a GNN augmented with deterministic clustering achieve better performance compared to our models.
Analyzing samples in this dataset suggests that in graphs with dense communities, such as cliques, our model struggles to properly detect the dense sub-graphs.
Future Directions : We plan to extend our models to also perform node classiﬁcation by attending to the node representations and centroids of the clusters from different layers of hierarchy that nodes belongs to.
Moreover, we are planning to evaluate other graph diffusion models, e.g., Personalized PageRank and heat kernel, to initialize the topological embeddings.
We are also planing to investigate the representation learning capabilities of the proposed models in self-supervised setting.
A A PPENDIX A. I MPLEMENTATION D ETAILS
We implemented the model with PyTorch (Paszke et al., 2017) and optimized it using Adam (Kingma & Ba, 2014) optimizer.
We trained the model for a maximum number of 2000 epochs and decayed the learning rate every 500 epochs by 0.5.
The model uses batch-normalization (Ioffe & Szegedy, 2015), skip-connections, LeakyRelu activation functions, and dropout (Srivastava et al., 2014) for regularization.
We also set the temperature in Students t-distribution to 1.0 and the restart probability in RWR to 0.1.
We decided the hidden dimension and the number of model parameters using random hyper-parameter search strategy.
The best performing hyper-parameters for the datasets are shown in Table 4.
A. D ATASET S TATISTICS
Table 5 summarizes the statistics of the datasets used for graph classiﬁcation and regression tasks.
A. EFFECT OF E - GAT
In section 4.4.1, we introduced e-GAT.
Figures 3a and 3b illustrate the RMSE and R 2 score on the validation set of the ESOL dataset achieved by a MemGNN model using both GAT and e-GAT as the query network, respectively.
As shown, e-GAT performs better compared to GAT on both metrics.
A. R ANDOM W ALK WITH R ESTART
Suppose an agent randomly traverses a graph starting from node i and iteratively walks towards its neighbors with a probability proportional to the edge weight that connects them.
The agent also can randomly restart the traverse with probability p .
Eventually, the agent will stop at node j with a probability called relevance score of node j with respect to node i (Tong et al., 2006).
The relevance score of node i with every other node of the graph is deﬁned as follows:
[Equation]
(12) where (cid:126)t i is the RWR score corresponding to node i , p is the restart probability, ˜ A is the normalized adjacency matrix, and (cid:126)e i is an one-hot vector representation of node i .
Note that the restart probability deﬁnes how far the agent can walk from the source node and therefore (cid:126)t i represents the trad-off between local and global information around node i .
[Figure] [Figure]
[Figure] [Figure]
(a)
[Figure] [Figure]
[Figure]
(b)
[Table]
A.
[Table]
L EARNED C LUSTERS
Figure 4 shows how unsupervised loss helps the model to push the nodes into distinct clusters.
Figures 4a and 4c illustrates clusters with unsupervised loss and Figures 4b and 4d show computed clusters without unsupervised loss.
This suggests that unsupervised loss helps the model to avoid trivial solutions by collapsing the latent node representations into meaningless clusters.
Also, Figure 5 represents meaningful chemical groups extracted by MemGNN.
Figures 5b and 5d are from LIPO and ﬁgure 5a and 5c are from ESOL dataset respectively.
[Table]
Enzymes classiﬁcation  32.
Proteins classiﬁcation  39.
DD classiﬁcation  284.
Collab classiﬁcation  74.
Reddit-B classiﬁcation  429.
Bace classiﬁcation  34.
Tox classiﬁcation  17.
ESOL regression13.
Lipophilicity regression27.
[Figure] [Figure]