D EEP G RAPH I NFOMAX
Anonymous authors
Paper under double-blind review
A BSTRACT
We present Deep Graph Infomax (DGI), a general approach for learning node representations within graph-structured data in an unsupervised manner.
DGI relies on maximizing mutual information between patch representations and corresponding high-level summaries of graphs—both derived using established graph convolutional network architectures.
The learnt patch representations summarize subgraphs centered around nodes of interest and can thus be reused for downstream node-wise learning tasks.
In contrast to most prior approaches to unsupervised learning with GCNs, DGI does not rely on random walk objectives and is readily applicable to both transductive and inductive learning setups
We demon strate competitive performance on a variety of node classiﬁcation benchmarks, which at times even exceeds the performance of supervised learning
I NTRODUCTION
Generalizing neural networks to graph-structured inputs is one of the current major challenges of machine learning (Bronstein et al., 2017; Hamilton et al., 2017b; Battaglia et al., 2018).
While signiﬁcant strides have recently been made, notably with graph convolutional networks (Kipf &
Welling, 2016a; Gilmer et al., 2017; Veliˇckovi´c et al., 2018), most successful methods use supervised learning , which is often not possible as most graph data in the wild is unlabeled.
In addition, it is often desirable to discover novel or interesting structure from large-scale graphs, and as such, unsupervised graph learning is essential for many important tasks.
Currently, the dominant algorithms for unsupervised representation learning with graph-structured data rely on random walk-based objectives (Grover & Leskovec, 2016;
Perozzi et al., 2014; Tang et al., 2015; Hamilton et al., 2017a), sometimes further simpliﬁed to reconstruct adjacency information (Kipf & Welling, 2016b; Duran & Niepert, 2017).
The underlying intuition is to train an encoder network so that nodes that are “close” in the input graph are also “close” in the representation space.
While powerful—and related to traditional metrics such as the personalized PageRank score (Jeh & Widom, 2003)—random walk methods suffer from known limitations.
Most prominently, the random-walk objective is known to over-emphasize proximity information at the expense of structural information (Ribeiro et al., 2017), and performance is highly dependent on hyperparameter choice (Grover & Leskovec, 2016;
Perozzi et al., 2014).
Moreover, with the introduction of stronger encoder models based on graph convolutions (Gilmer et al., 2017), it is unclear whether randomwalk objectives actually provide any useful signal, as these encoders already enforce an inductive bias that neighboring nodes have similar representations.
In this work, we propose an alternative objective for unsupervised graph learning that is based upon mutual information , rather than random walks.
Recently, scalable estimation of mutual information was made both possible and practical through Mutual Information Neural Estimation (MINE, Belghazi et al., 2018), which relies on training a statistics network as a classiﬁer of samples coming from the joint distribution of two random variables and their product of marginals.
Following on
MINE, Hjelm et al.
(2018) introduced Deep InfoMax (DIM) for learning representations of highdimensional data.
DIM trains an encoder model to maximize the mutual information between a high-level “global” representation and “local” parts of the input (such as patches of an image).
This encourages the encoder to carry the type of information that is present in all locations (and thus are globally relevant ), such as would be the case of a class label.
DIM relies heavily on convolutional neural network structure in the context of image data, and to our knowledge, no work has applied mutual information maximization to graph-structured inputs.
Here, we adapt ideas from DIM to the graph domain, which can be thought of as having a more general type of structure than the ones captured by convolutional neural networks.
In the following sections, we introduce our method called Deep Graph Infomax (DGI).
We demonstrate that the representation learned by DGI is consistently competitive on both transductive and inductive classiﬁcation tasks, often outperforming both supervised and unsupervised strong baselines in our experiments.
R ELATED W ORK
Contrastive methods .
An important approach for unsupervised learning of representations is to train an encoder to be contrastive between representations that capture statistical dependencies of interest and those that do not.
For example, a contrastive approach may employ a scoring function , training the encoder to increase the score on “real” input (a.k.a, positive examples) and decrease the score on “fake” input (a.k.a., negative samples).
Contrastive methods are central to many popular word-embedding methods (Collobert & Weston, 2008; Mnih & Kavukcuoglu, 2013; Mikolov et al., 2013), but they are found in many unsupervised algorithms for learning representations of graphstructured input as well.
There are many ways to score a representation, but in the graph literature the most common techniques use classiﬁcation (Perozzi et al., 2014; Grover & Leskovec, 2016;
Kipf & Welling, 2016b; Hamilton et al., 2017b), though other scoring functions are used (Duran & Niepert, 2017; Bojchevski & G¨unnemann, 2018).
DGI is also contrastive in this respect, as our objective is based on classifying local-global pairs and negative-sampled counterparts.
Sampling strategies .
A key implementation detail to contrastive methods is how to draw positive and negative samples.
The prior work above on unsupervised graph representation learning relies on a local contrastive loss (enforcing proximal nodes to have similar embeddings).
Positive samples typically correspond to pairs of nodes that appear together within short random walks in the graph—from a language modelling perspective, effectively treating nodes as words and random walks as sentences .
Recent work by Bojchevski & G¨unnemann (2018) uses node-anchored sampling as an alternative.
The negative sampling for these methods is primarily based on sampling of random pairs, with recent work adapting this approach to use a curriculum-based negative sampling scheme (with progressively “closer” negative examples; Ying et al., 2018a) or introducing an adversary to select the negative examples (Bose et al., 2018).
Predictive coding .
Contrastive predictive coding (CPC, Oord et al., 2018) is another method for learning deep representations based on mutual information maximization.
Like the models above,
CPC is also contrastive, in this case using an estimate of the conditional density (in the form of noise contrastive estimation, Gutmann & Hyv¨arinen, 2010) as the scoring function.
However, unlike our approach, CPC and the graph methods above are all predictive : the contrastive objective effectively trains a predictor between structurally-speciﬁed parts of the input (e.g., between neighboring node pairs or between a node and its neighborhood).
Our approach differs in that we contrast global / local parts of a graph simultaneously, where the global variable is computed from all local variables.
To the best of our knowledge, the sole prior works that instead focuses on contrasting “global” and “local” representations on graphs do so via (auto-)encoding objectives on the adjacency matrix (Wang et al., 2016) and incorporation of community-level constraints into node embeddings (Wang et al., 2017).
Both methods rely on matrix factorization-style losses and are thus not scalable to larger graphs.
DGI M ETHODOLOGY
In this section, we will present the Deep Graph Infomax method in a top-down fashion: starting with an abstract overview of our speciﬁc unsupervised learning setup, followed by an exposition of the objective function optimized by our method, and concluding by enumerating all the steps of our procedure in a single-graph setting.
3. G RAPH - BASED UNSUPERVISED LEARNING
We assume a generic graph-based unsupervised machine learning setup: we are provided with a set of node features , X = { (cid:126)x 1 , (cid:126)x 2 , . . .
, (cid:126)x N } , where N is the number of nodes in the graph and (cid:126)x i ∈ R F represents the features of node i .
We are also provided with relational information between these nodes in the form of an adjacency matrix , A ∈ R N × N .
While A may consist of arbitrary real numbers (or even arbitrary edge features), in all our experiments we will assume the graphs to be unweighted , i.e. A ij = 1 if there exists an edge i → j in the graph and A ij = 0 otherwise.
Our objective is to learn an encoder , E : R N × F × R N × N → R N × F (cid:48) , such that E ( X , A )
=
H = { (cid:126)h 1 ,(cid:126)h 2 , . . .
,(cid:126)h N } represents high-level representations (cid:126)h i ∈ R F (cid:48) for each node i .
These representations may then be retrieved and used for downstream tasks, such as node classiﬁcation.
Here we will focus on graph convolutional encoders—a ﬂexible class of node embedding architectures, which generate node representations by repeated aggregation over local node neighborhoods (Gilmer et al., 2017).
A key consequence is that the produced node embeddings, (cid:126)h i , summarize a patch of the graph centered around node i rather than just the node itself.
In what follows, we will often refer to (cid:126)h i as patch representations to emphasize this point.
3. L OCAL - GLOBAL MUTUAL INFORMATION MAXIMIZATION
Our approach to learning the encoder relies on maximizing local mutual information —that is, we seek to obtain node (i.e., local) representations that capture the global information content of the entire graph, represented by a summary vector , (cid:126)s .
In order to obtain the graph-level summary vectors, (cid:126)s , we leverage a readout function , R : R N × F → R F , and use it to summarize the obtained patch representations into a graph-level representation ; i.e., (cid:126)s = R ( E ( X , A )) .
As a proxy for maximizing the local mutual information, we employ a discriminator , D : R F × R F → R , such that D ( (cid:126)h i ,(cid:126)s ) represents the probability scores assigned to this patch-summary pair (should be higher for patches contained within the summary).
Negative samples for D are provided by pairing the summary (cid:126)s from ( X , A ) with patch representations (cid:126) (cid:101)
h j of an alternative graph, ( (cid:101)
X , (cid:101)
A ) .
In a multi-graph setting, such graphs may be obtained as other elements of a training set.
However, for a single graph, an explicit (stochastic) corruption function , C : R N × F × R N × N → R M × F × R M × M is required to obtain a negative example from the original graph, i.e. ( (cid:101)
X , (cid:101)
A ) =
C ( X , A ) .
The choice of the negative sampling procedure will govern the speciﬁc kinds of structural information that is desirable to be captured as a byproduct of this maximization.
For the objective, we follow the intuitions from Deep InfoMax (DIM, Hjelm et al., 2018) and use a noise-contrastive type objective with a standard binary cross-entropy (BCE) loss between the samples from the joint (positive examples) and the product of marginals (negative examples).
Following their work, we use the following objective 1 :
[Equation]
This approach effectively maximizes mutual information between (cid:126)h i and (cid:126)s , based on the JensenShannon divergence 2 between the joint and the product of marginals.
As all of the derived patch representations are driven to preserve mutual information with the global graph summary, this allows for discovering and preserving similarities on the patch-level—for example, distant nodes with similar structural roles (which are known to be a strong predictor for many node classiﬁcation tasks; Donnat et al., 2018).
Note that this is a “reversed” version of the argument given by Hjelm et al.
(2018): for node classiﬁcation, our aim is for the patches to establish links to similar patches across the graph, rather than enforcing the summary to contain all of these similarities (however, both of these effects should in principle occur simultaneously).
3. T HEORETICAL MOTIVATION
We now provide some intuition that connects the classiﬁcation error of our discriminator to mutual information maximization on graph representations.
Lemma 1.
Let { X ( k ) } | X | k
=1 be a set of node representations drawn from an empirical probability distribution of graphs, p ( X ) , with ﬁnite number of elements, | X | , such that p ( X ( k ) )
=
p ( X ( k (cid:48) ) )
∀ k, k (cid:48) .
Let R ( · ) be a deterministic readout function on graphs and (cid:126)s ( k ) =
R ( X ( k ) ) be the summary vector of the k -th graph, with marginal distribution p ( (cid:126)s ) .
The optimal classiﬁer between the joint distribution p ( X ,(cid:126)s ) and the product of marginals p ( X ) p ( (cid:126)s ) , assuming class balance, has an error rate upper bounded by Err ∗ =(cid:80) | X | k =1 p ( (cid:126)s ( k ) ) 2 .
This upper bound is achieved if R is injective.
Proof.
Denote by Q ( k ) the set of all graphs in the input set that are mapped to (cid:126)s ( k ) by R , i.e.
Q ( k ) =
{ X ( j ) | R ( X ( j ) ) =
(cid:126)s ( k ) } .
As R ( · ) is deterministic, samples from the joint, ( X ( k ) ,(cid:126)s ( k ) ) are drawn from the product of marginals with probability p ( (cid:126)s ( k ) )
p ( X ( k ) ) , which decomposes into: p ( (cid:126)s
[Equation] [Equation]
p
[Equation]
For convenience, let ρ ( k ) =
p
[Equation]
X
[Equation]
k
[Equation]
X
[Equation]
X
[Equation]
As, by deﬁnition, X ( k ) ∈ Q ( k ) , it holds that ρ ( k ) ≤ 1 .
This probability ratio is maximized at 1 when Q ( k ) =
{ X ( k ) } , i.e. when R is injective for X ( k ) .
The probability of drawing any sample of the joint from the product of marginals is then bounded above by (cid:80) |
X | k =1 p ( (cid:126)s ( k ) ) 2 .
As the probability of drawing ( X ( k ) ,(cid:126)s ( k ) ) from the joint is ρ ( k ) p ( (cid:126)s ( k ) ) ≥ ρ ( k ) p ( (cid:126)s ( k ) ) 2 , we know that classifying these samples as coming from the joint has a lower error than classifying them as coming from the product of marginals.
The error rate of such a classiﬁer is then the probability of drawing a sample from the joint as a sample from product of marginals under the mixture probability, which we can bound by Err ≤
[Equation]
| X | k =1 p (
[Equation]
k ) )
2 , with the upper bound achieved, as above, when R ( · ) is injective for all elements of { X ( k ) } .
It may be useful to note that 1 2 | X | ≤ Err ∗ ≤ 12 .
The ﬁrst result is obtained via a trivial application of Jensen’s inequality, while the other extreme is reached only in the edge case of a constant readout function (when every example from the joint is also an example from the product of marginals, so no classiﬁer performs better than chance).
Corollary 1.
From now on, assume that the readout function used, R , is injective.
Assume the number of allowable states in the space of (cid:126)s , | (cid:126)s | , is greater than or equal to | X | .
Then, for (cid:126)s (cid:63) , the optimal summary under the classiﬁcation error of an optimal classiﬁer between the joint and the product of marginals, it holds that | (cid:126)s (cid:63) | = | X | .
Proof.
By injectivity of R , we know that (cid:126)s (cid:63) = argmin
(cid:126)s Err ∗ .
As the upper error bound, Err ∗ , is a simple geometric sum, we know that this is minimized when p ( (cid:126)s ( k ) ) is uniform.
As R ( · ) is deterministic, this implies that each potential summary state would need to be used at least once.
Combined with the condition | (cid:126)s | ≥ | X | , we conclude that the optimum has | (cid:126)s (cid:63) | = | X | .
Theorem 1.
(cid:126)s (cid:63) =
argmax (cid:126)s MI( X ; (cid:126)s ) , where MI is mutual information.
Proof.
This follows from the fact that the mutual information is invariant under invertible transforms.
As | (cid:126)s (cid:63) | = | X | and R is injective, it has an inverse function, R − 1 .
It follows then that, for any (cid:126)s , MI( X ; (cid:126)s ) ≤ H ( X )
=
MI( X ; X ) =
MI( X ; R ( X ))
=
MI( X ; (cid:126)s (cid:63) ) , where H is entropy.
Theorem 1 shows that for ﬁnite input sets and suitable deterministic functions, minimizing the classiﬁcation error in the discriminator can be used to maximize the mutual information between the input and output.
However, as was shown in Hjelm et al.
(2018), this objective alone is not enough to learn useful representations.
As in their work, we discriminate between the global summary vector and local high-level representations.
~x i ~ e x j ( X , A ) ( e
X , e
A ) ~h i ~ e h j ( H , A ) ( e
H , e
A )
E
C
E ~s R
D
D + −
Theorem 2.
Let X ( k ) i
= { (cid:126)x j } j ∈ n ( X ( k ) ,i ) be the neighborhood of the node i in the k -th graph that collectively maps to its high-level features, (cid:126)h i
= E ( X ( k ) i ) , where n is the neighborhood function that returns the set of neighborhood indices of node i for graph X ( k ) , and E is a deterministic encoder function.
Let us assume that | X i | = | X | = | (cid:126)s | ≥ | (cid:126)h i | .
Then, the (cid:126)h i that minimizes the classiﬁcation error between p ( (cid:126)h i ,(cid:126)s ) and p ( (cid:126)h i ) p ( (cid:126)s ) also maximizes MI( X ( k ) i ; (cid:126)h i ) .
Proof.
Given our assumption of | X i | = | (cid:126)s | , there exists an inverse X i
=
R − 1 ( (cid:126)s ) , and therefore (cid:126)h i =
E ( R − 1 ( (cid:126)s )) , i.e. there exists a deterministic function ( E ◦ R − 1 ) mapping (cid:126)s to (cid:126)h i .
The optimal classiﬁer between the joint p ( (cid:126)h i ,(cid:126)s ) and the product of marginals p ( (cid:126)h i ) p ( (cid:126)s ) then has (by Lemma 1) an error rate upper bound of Err ∗ =(cid:80) | X | k =1 p ( (cid:126)h ( k ) i ) 2 .
Therefore (as in Corollary 1), for the optimal (cid:126)h i , | (cid:126)h i | =
|
X i | , which by the same arguments as in Theorem 1 maximizes the mutual information between the neighborhood and high-level features, MI( X ( k ) i ; (cid:126)h i ) .
This motivates our use of a classiﬁer between samples from the joint and the product of marginals, and using the binary cross-entropy (BCE) loss to optimize this classiﬁer is well-understood in the context of neural network optimization.
3. O VERVIEW OF DGI
Assuming the single-graph setup (i.e., ( X , A ) provided as input), we will now summarize the steps of the Deep Graph Infomax procedure:
Sample a negative example by using the corruption function: (
[Equation]
Obtain patch representations, (cid:126)h i for the input graph by passing it through the encoder:
H = E
( X , A
[Equation]
=
[Equation] [Equation]
,(cid:126)h N } . 3.
Obtain patch representations, (cid:126) (cid:101) h j for the negative example by passing it through the encoder:
[Equation]
Summarize the input graph by passing its patch representations through the readout function: (cid:126)s =
[Equation]
H ) .
Update parameters of E , R and D by applying gradient descent to maximize Equation 1.
This algorithm is fully summarized by Figure 1.
C LASSIFICATION PERFORMANCE
We have assessed the beneﬁts of the representation learnt by the DGI encoder on a variety of node classiﬁcation tasks (transductive as well as inductive), obtaining competitive results.
In each case,
[Table]
DGI was used to learn patch representations in a fully unsupervised manner, followed by evaluating the node-level classiﬁcation utility of these representations.
This was performed by directly using these representations to train and test a simple linear (logistic regression) classiﬁer.
4. D ATASETS
We follow the experimental setup described in Kipf & Welling (2016a) and Hamilton et al.
(2017a)
on the following benchmark tasks: (1) classifying research papers into topics on the Cora, Citeseer and Pubmed citation networks (Sen et al., 2008); (2) predicting the community structure of a social network modeled with Reddit posts; and (3) classifying protein roles within protein-protein interaction (PPI) networks (Zitnik & Leskovec, 2017), requiring generalisation to unseen networks.
Further information on the datasets may be found in Table 1 and Appendix A.
4. E XPERIMENTAL SETUP
For each of three experimental settings (transductive learning, inductive learning on large graphs, and multiple graphs), we employed distinct encoders and corruption functions appropriate to that setting (described below).
Transductive
learning
For the
transductive
learning
tasks (Cora, Citeseer and Pubmed), our encoder is a one-layer Graph Convolutional Network (GCN) model (Kipf & Welling, 2016a), with the following propagation rule:
[Equation]
where ˆA =
A + I N is the adjacency matrix with inserted self-loops and ˆD is its corresponding degree matrix; i.e. ˆ D ii = (cid:80)
j
ˆ A ij .
For the nonlinearity, σ , we have applied the parametric ReLU (PReLU) function (He et al., 2015), and Θ ∈ R F × F (cid:48) is a learnable linear transformation applied to every node, with F (cid:48)
= 512 features being computed (specially, F (cid:48)
= 256 on Pubmed due to memory limitations).
The corruption function used in this setting is designed to encourage the representations to properly encode structural similarities of different nodes in the graph; for this purpose, C preserves the original adjacency matrix ( (cid:101)
A = A ), whereas the corrupted features, (cid:101)
X , are obtained by row-wise shufﬂing of X .
That is, the corrupted graph consists of exactly the same nodes as the original graph, but they are located in different places in the graph, and will therefore receive different patch representations.
We demonstrate DGI is stable to other choices of corruption functions in Appendix C, but we ﬁnd those that preserve the graph structure result in the strongest features.
Inductive learning on large graphs .
For inductive learning, we may no longer use the GCN update rule in our encoder (as the learned ﬁlters rely on a ﬁxed and known adjacency matrix); instead, we apply the mean-pooling propagation rule, as used by GraphSAGE-GCN (Hamilton et al., 2017a):
[Equation]
with parameters deﬁned as in Equation 3.
Note that multiplying by ˆ D − 1 actually performs a normalized sum (hence the mean-pooling).
While Equation 4 explicitly speciﬁes the adjacency and degree
[Figure]
matrices, they are not needed : identical inductive behaviour may be observed by a constant attention mechanism across the node’s neighbors, as used by the Const-GAT model (Veliˇckovi´c et al., 2018).
For Reddit, our encoder is a three-layer mean-pooling model with skip connections (He et al., 2016):
[Equation]
where (cid:107) is featurewise concatenation (i.e. the central node and its neighborhood are handled separately).
We compute F (cid:48)
= 512 features in each MP layer, with the PReLU activation for σ .
Given the large scale of the dataset, it will not ﬁt into GPU memory entirely.
Therefore, we use the subsampling approach of Hamilton et al.
(2017a), where a minibatch of nodes is ﬁrst selected, and then a subgraph centered around each of them is obtained by sampling node neighborhoods with replacement .
Speciﬁcally, we sample 10, 10 and 25 neighbors at the ﬁrst, second and third level, respectively—thus, each subsampled patch has 1 + 10 + 100 + 2500 = 2611 nodes.
Only the computations necessary for deriving the central node i ’s patch representation, (cid:126)h i , are performed.
These representations are then used to derive the summary vector, (cid:126)s , for the minibatch (Figure 2).
We used minibatches of 256 nodes throughout training.
To deﬁne our corruption function in this setting, we use a similar approach as in the transductive tasks, but treat each subsampled patch as a separate graph to be corrupted (i.e., we row-wise shufﬂe the feature matrices within a subsampled patch).
Note that this may very likely cause the central node’s features to be swapped out for a sampled neighbor’s features, further encouraging diversity in the negative samples.
The patch representation obtained in the central node is then submitted to the discriminator.
Inductive learning on multiple graphs .
For the PPI dataset, inspired by previous successful supervised architectures (Veliˇckovi´c et al., 2018), our encoder is a three-layer mean-pooling model with dense skip connections (He et al., 2016; Huang et al., 2017):
[Equation]
where W skip is a learnable projection matrix, and MP is as deﬁned in Equation 4.
We compute
F (cid:48)
= 512 features in each MP layer, using the PReLU activation for σ .
In this multiple-graph setting, we opted to use randomly sampled training graphs as negative examples (i.e., our corruption function simply samples a different graph from the training set).
We found this method to be the most stable, considering that over 40% of the nodes have all-zero features in this dataset.
To further expand the pool of negative examples, we also apply dropout (Srivastava et al., 2014) to the input features of the sampled graph.
We found it beneﬁcial to standardize the learnt embeddings across the training set prior to providing them to the logistic regression model.
Readout, discriminator, and additional training details .
Across all three experimental settings, we employed identical readout functions and discriminator architectures.
For the readout function, we use a simple averaging of all the nodes’ features:
[Equation]
where σ is the logistic sigmoid nonlinearity.
While we have found this readout to perform the best across all our experiments, we assume that its power will diminish with the increase in graph size, and in those cases, more sophisticated readout architectures such as set2vec (Vinyals et al., 2015) or
DiffPool (Ying et al., 2018b) are likely to be more appropriate.
The discriminator scores summary-patch representation pairs by applying a simple bilinear scoring function (similar to the scoring used by Oord et al.
[Equation]
Here, W is a learnable scoring matrix and σ is the logistic sigmoid nonlinearity, used to convert scores into probabilities of ( (cid:126)h i ,(cid:126)s ) being a positive example.
All models are initialized using Glorot initialization (Glorot & Bengio, 2010) and trained to maximize the mutual information provided in Equation 1 on the available nodes (all nodes for the transductive, and training nodes only in the inductive setup) using the Adam SGD optimizer (Kingma & Ba, 2014) with an initial learning rate of 0.001 (specially, 10 − 5 on Reddit).
On the transductive datasets, we use an early stopping strategy on the observed training loss, with a patience ofepochs.
On the inductive datasets we train for a ﬁxed number of epochs (150 on Reddit, 20 on PPI).
4. R ESULTS
The results of our comparative evaluation experiments are summarized in Table 2.
For the transductive tasks, we report the mean classiﬁcation accuracy (with standard deviation) on the test nodes of our method after 50 runs of training (followed by logistic regression), and reuse the metrics already reported in Kipf & Welling (2016a) for the performance of DeepWalk and GCN, as well as Label Propagation (LP) (Zhu et al., 2003) and Planetoid (Yang et al.
, 2016)—a representative supervised random walk method.
Specially, we provide results for training the logistic regression on raw input features, as well as DeepWalk with the input features concatenated.
For the inductive tasks, we report the micro-averaged F 1 score on the (unseen) test nodes, averaged after 50 runs of training, and reuse the metrics already reported in Hamilton et al.
(2017a)
for the other techniques.
Speciﬁcally, as our setup is unsupervised, we compare against the unsupervised GraphSAGE approaches.
We also provide supervised results for two related architectures—
FastGCN
(Chen et al., 2018) and Avg.
pooling (Zhang et al., 2018).
Our results demonstrate strong performance being achieved across all ﬁve datasets.
We particularly note that the DGI approach is competitive with the results reported for the GCN model with the supervised loss , even exceeding its performance on the Cora and Citeseer datasets.
We assume that these beneﬁts stem from the fact that, indirectly, the DGI approach allows for every node to have access to structural properties of the entire graph, whereas the supervised GCN is limited to only two-layer neighborhoods (by the extreme sparsity of the training signal and the corresponding threat of overﬁtting).
It should be noted that, while we are capable of outperforming equivalent supervised encoder architectures, our performance still does not surpass the current supervised transductive state of the art (which is held by methods such as GraphSGAN (Ding et al., 2018)).
We further observe that the DGI method successfully outperformed all the competing unsupervised GraphSAGE approaches on the Reddit and PPI datasets—thus verifying the potential of methods based on local mutual information maximization in the inductive node classiﬁcation domain.
Our Reddit results are competitive with the supervised state of the art, whereas on PPI the gap is still large—we believe this can be attributed to the extreme sparsity of available node features (over 40% of the nodes having all-zero features), that our encoder heavily relies on.
[Table]
We note that a randomly initialized graph convolutional network may already extract highly useful features and represents a strong baseline—a well-known fact, considering its links to the WeisfeilerLehman graph isomorphism test (Weisfeiler & Lehman, 1968), that have already been highlighted and analyzed by Kipf & Welling (2016a) and Hamilton et al. (2017a).
As such, we also provide, as
Random-Init , the logistic regression performance on embeddings obtained from a randomly initialized encoder.
Besides demonstrating that DGI is able to further improve on this strong baseline, it particularly reveals that, on the inductive datasets, previous random walk-based negative sampling methods may have been ineffective for learning appropriate features for the classiﬁcation task.
Lastly, it should be noted that deeper encoders correspond to more pronounced mixing between recovered patch representations, reducing the effective variability of our positive/negative examples’ pool.
We believe that this is the reason why shallower architectures performed better on some of the datasets.
While we cannot say that these trends will hold in general, with the DGI loss function we generally found beneﬁts from employing wider , rather than deeper models.
Q UALITATIVE ANALYSIS
We performed a diverse set of analyses on the embeddings learnt by the DGI algorithm in order to better understand the properties of DGI.
We focus our analysis exclusively on the Cora dataset (as it has the smallest number of nodes, signiﬁcantly aiding clarity).
A standard set of “evolving” t-SNE plots (Maaten & Hinton, 2008) of the embeddings is given in
Figure 3.
As expected given the quantitative results, the learnt embeddings’ 2D projections exhibit discernible clustering in the 2D projected space (especially compared to the raw features and
Random-Init), which respects the seven topic classes of Cora.
The projection obtains a Silhouette score (Rousseeuw, 1987) of 0.234, which compares favorably with the previous reported score of 0.158 for Embedding Propagation (Duran & Niepert, 2017).
We ran further analyses, revealing insights into DGI’s mechanism of learning, isolating biased embedding dimensions for pushing the negative example scores down and using the remainder to encode useful information about positive examples.
We leverage these insights to retain competitive performance to the supervised GCN even after half the dimensions are removed from the patch representations provided by the encoder.
These—and several other—qualitative and ablation studies can be found in Appendix B.
C ONCLUSIONS
We have presented Deep Graph Infomax (DGI), a new approach for learning unsupervised representations on graph-structured data.
By leveraging local mutual information maximization across the graph’s patch representations, obtained by powerful graph convolutional architectures, we are able to obtain node embeddings that are mindful of the global structural properties of the graph.
This enables competitive performance across a variety of both transductive and inductive classiﬁcation tasks, at times even outperforming relevant supervised architectures.
A F URTHER DATASET DETAILS
Transductive learning .
We utilize three standard citation network benchmark datasets—Cora, Citeseer and Pubmed (Sen et al., 2008)—and closely follow the transductive experimental setup of Yang et al.
In all of these datasets, nodes correspond to documents and edges to (undirected) citations.
Node features correspond to elements of a bag-of-words representation of a document.
Each node has a class label.
We allow for only 20 nodes per class to be used for training—however, honouring the transductive setup, the unsupervised learning algorithm has access to all of the nodes’ feature vectors.
The predictive power of the learned representations is evaluated on 1000 test nodes.
Inductive learning on large graphs .
We use a large graph dataset (231,443 nodes and 11,606, edges) of Reddit posts created during September 2014 (derived and preprocessed as in Hamilton et al.
(2017a)).
The objective is to predict the posts’ community ( “subreddit” ), based on the GloVe embeddings of their content and comments (Pennington et al., 2014), as well as metrics such as score or number of comments.
Posts are linked together in the graph if the same user has commented on both.
Reusing the inductive setup of Hamilton et al. (2017a), posts made in the ﬁrst 20 days of the month are used for training, while the remaining posts are used for validation or testing and are invisible to the training algorithm.
Inductive learning on multiple graphs .
We make use of a protein-protein interaction (PPI) dataset that consists of graphs corresponding to different human tissues (Zitnik & Leskovec, 2017).
The dataset contains 20 graphs for training, 2 for validation and 2 for testing.
Critically, testing graphs remain completely unobserved during training.
To construct the graphs, we used the preprocessed data provided by Hamilton et al. (2017a).
Each node has 50 features that are composed of positional gene sets, motif gene sets and immunological signatures.
There are 121 labels for each node set from gene ontology, collected from the Molecular Signatures Database (Subramanian et al., 2005), and a node can possess several labels simultaneously.
B F URTHER QUALITATIVE ANALYSIS
Visualizing discriminator scores .
After obtaining the t-SNE visualizations, we turned our attention to the discriminator—and visualized the scores it attached to various nodes, for both the positive and a (randomly sampled) negative example (Figure 4).
From here we can make an interesting observation—within the “clusters” of the learnt embeddings on the positive Cora graph, only a handful of “hot” nodes are selected to receive high discriminator scores.
This suggests that there may be a clear distinction between embedding dimensions used for discrimination and classiﬁcation, which we more thoroughly investigate in the next paragraph.
In addition, we may observe that, as expected, the model is unable to ﬁnd any strong structure within a negative example.
Lastly, a few negative examples achieve high discriminator scores—a phenomenon caused by the existence of
[Figure] [Figure]
[Figure]
low-degree nodes in Cora (making the probability of a node ending up in an identical context it had in the positive graph non-negligible).
Impact and role of embedding dimensions .
Guided by the previous result, we have visualized the embeddings for the top-scoring positive and negative examples (Figure 5).
The analysis revealed existence of distinct dimensions in which both the positive and negative examples are strongly biased .
We hypothesize that, given the random shufﬂing, the average expected activation of a negative example is zero
[Figure]
and therefore strong biases are required to “push” the example down in the discriminator.
The positive examples may then use the remaining dimensions to both counteract this bias and encode patch similarity.
To substantiate this claim, we order the 512 dimensions based on how distinguishable the positive and negative examples are in them (using p -values obtained from a t-test as a proxy).
We then remove these dimensions from the embedding, respecting this order—either starting from the most distinguishable ( p ↑ ) or least distinguishable dimensions ( p ↓ )—monitoring how this affects both classiﬁcation and discriminator performance (Figure 6).
The observed trends largely support our hypothesis: if we start by removing the biased dimensions ﬁrst ( p ↓ ), the classiﬁcation performance holds up for much longer (allowing us to remove over half of the embedding dimensions while remaining competitive to the supervised GCN), and the positive examples mostly remain correctly discriminated until well over half the dimensions are removed.
C R OBUSTNESS TO C HOICE OF C ORRUPTION F UNCTION
Here, we consider alternatives to our corruption function, C , used to produce negative graphs.
We generally ﬁnd that, for the node classiﬁcation task, DGI is stable and robust to different strategies.
However, for learning graph features towards other kinds of tasks, the design of appropriate corruption strategies remains an area of open research.
Our corruption function described in Section 4.2 preserves the original adjacency matrix ( (cid:101)
A =
A ) but corrupts the features, (cid:101)
X , via row-wise shufﬂing of X .
In this case, the negative graph is constrained to be isomorphic to the positive graph, which should not have to be mandatory.
We can instead produce a negative graph by directly corrupting the adjacency matrix.
Therefore, we ﬁrst consider an alternative corruption function C which preserves the features ( (cid:101)
X = X ) but instead adds or removes edges from the adjacency matrix ( (cid:101)
A (cid:54) =
A ).
This is done by sampling, i.i.d., a switch parameter Σ ij , which determines whether to corrupt the adjacency matrix at position ( i, j ) .
Assuming a given corruption rate , ρ , we may deﬁne C as performing the following operations:
[Equation] [Equation]
(12) where ⊕ is the XOR (exclusive OR) operation.
This alternative strategy produces a negative graph with the same features, but different connectivity.
Here, the corruption rate of ρ = 0 corresponds to an unchanged adjacency matrix (i.e. the positive and negative graphs are identical in this case).
In this regime, learning is impossible for the discriminator, and the performance of DGI is in line with a randomly initialized DGI model.
At higher rates of noise, however, DGI produces competitive embeddings.
We also consider simultaneous feature shufﬂing ( (cid:101)
X (cid:54) =
X ) and adjacency matrix perturbation ( (cid:101)
A (cid:54) =
A ), both as described before.
We ﬁnd that DGI still learns useful features under this compound corruption strategy—as expected, given that feature shufﬂing is already equivalent to an (isomorphic) adjacency matrix perturbation.
From both studies, we may observe that a certain lower bound on the positive graph perturbation rate is required to obtain competitive node embeddings for the classiﬁcation task on Cora.
Furthermore, the features learned for downstream node classiﬁcation tasks are most powerful when the negative graph has similar levels of connectivity to the positive graph.
The classiﬁcation performance peaks when the graph is perturbed to a reasonably high level, but remains sparse ; i.e. the mixing between the separate 1-step patches is not substantial, and therefore the pool of negative examples is still diverse enough.
Classiﬁcation performance is impacted only marginally at higher rates of corruption—corresponding to dense negative graphs, and thus a less rich negative example pool—but still considerably outperforming the unsupervised baselines we have considered.
This could be seen as further motivation for relying solely on feature shufﬂing, without adjacency perturbations—given that feature shufﬂing is a trivial way to guarantee a diverse set of negative examples, without incurring signiﬁcant computational costs per epoch.
The results of this study are visualized in Figures 7 and 8.
[Figure]
Classiﬁcation
[Figure] [Figure]