CS224W: Analysis of Networks Jure Leskovec,...

47
CS224W: Analysis of Networks Jure Leskovec, Stanford University http://cs224w.stanford.edu

Transcript of CS224W: Analysis of Networks Jure Leskovec,...

Page 1: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

CS224W: Analysis of NetworksJure Leskovec, Stanford University

http://cs224w.stanford.edu

Page 2: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

? ?

??

?Machine Learning

Node classification

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 212/4/17

Page 3: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

3

Raw Data

Structured Data

Learning Algorithm Model

Downstream prediction task

Feature Engineering

Automatically learn the features

¡ (Supervised)MachineLearningLifecycle:Thisfeature,thatfeature.Everysingletime!

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 4: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Goal:Efficienttask-independentfeaturelearningformachinelearning

innetworks!

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 4

vecnode 2𝑓: 𝑢 → ℝ&

ℝ&Feature representation,

embedding

u

12/4/17

Page 5: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Wemapeachnodeinanetworkintoalow-dimensionalspace§ Distributedrepresentationfornodes§ Similaritybetweennodesindicateslinkstrength§ Encodenetworkinformationandgeneratenoderepresentation

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 5

What is network embedding?• We map each node in a network into a low-

dimensional space– Distributed representation for nodes– Similarity between nodes indicate the link

strength – Encode network information and generate node

representation

17

Page 6: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Zachary’sKarateClubnetwork:

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 6

Example

• Zachary’s Karate Network:

18

Page 7: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Graphrepresentationlearningishard:¡ Imagesarefixedsize§ Convolutions(CNNs)

¡ Textislinear§ Slidingwindow(word2vec)

¡ Graphsareneitherofthese!§ Nodenumberingisarbitrary(nodeisomorphismproblem)

§ Muchmorecomplicatedstructure

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 712/4/17

Page 8: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

8

node2vec: Random Walk Based (Unsupervised)

Feature Learning

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

node2vec: Scalable Feature Learning for NetworksA. Grover, J. Leskovec. KDD 2016.

12/4/17

Page 9: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Goal: Embednodeswithsimilarnetworkneighborhoodscloseinthefeaturespace.

¡ Weframethisgoalasprediction-taskindependentmaximumlikelihoodoptimizationproblem.

¡ Keyobservation:Flexiblenotionofnetworkneighborhood𝑁𝑆(𝑢) ofnodeuleadstorichfeatures.

¡ Developbiased2nd orderrandomwalkprocedureStogeneratenetworkneighborhood𝑁𝑆(𝑢) ofnodeu.

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 9

Page 10: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Intuition: Findembeddingofnodestod-dimensionsthatpreservessimilarity

¡ Idea:Learnnodeembeddingsuchthatnearbynodesareclosetogether

¡ Givenanodeu,howdowedefinenearbynodes?§ 𝑁+ 𝑢 …neighbourhoodofu obtainedbysomestrategyS

10JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 11: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Given𝐺 = (𝑉, 𝐸),¡ Ourgoalistolearnamapping𝑓: 𝑢 → ℝ𝑑.

¡ Log-likelihoodobjective:max𝑓∑ log Pr(𝑁𝑆(𝑢)|𝑓 𝑢 )�𝑢∈𝑉

§ where𝑁𝑆(𝑢) isneighborhoodofnode𝑢.

¡ Givennode𝑢,wewanttolearnfeaturerepresentationspredictiveofnodesinitsneighborhood𝑁𝑆(𝑢).

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 11

Page 12: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

max𝑓

? log Pr(𝑁𝑆(𝑢)|𝑓 𝑢 )�

𝑢∈𝑉¡ Assumption: Conditionallikelihoodfactorizesoverthesetofneighbors.

log Pr(𝑁+(𝑢|𝑓 𝑢 ) = ? log Pr(𝑓(𝑛A)|𝑓 𝑢 )�

BC∈DE(F)¡ Softmax parametrization:Pr(𝑓(𝑛𝑖)|𝑓 𝑢 ) = exp(𝑓 𝑛𝑖 ⋅𝑓(𝑢))

∑ exp(𝑓 𝑣 ⋅𝑓(𝑢)))�𝑣∈𝑉

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 12

Page 13: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

maxL

? ? logexp(𝑓 𝑛A ⋅ 𝑓(𝑢))

∑ exp(𝑓 𝑣 ⋅ 𝑓(𝑢)))�M∈N

B∈DO(F)

F∈N¡ MaximizetheobjectiveusingStochasticGradientdescentwithnegativesampling.§ Computingthesummation isexpensive§ Idea: Justsampleacoupleof“negativenodes”§ Thismeansateachiterationonlyembeddings ofafewnodeswillbeupdatedatatime

§ Muchfastertrainingofembeddings

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 13

Page 14: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Twoclassicstrategiestodefineaneighborhood𝑁+ 𝑢 ofagivennode𝑢:

node2vec: Scalable Feature Learning for Networks

Aditya GroverStanford University

[email protected]

Jure LeskovecStanford University

[email protected]

ABSTRACTPrediction tasks over nodes and edges in networks require carefuleffort in engineering features for learning algorithms. Recent re-search in the broader field of representation learning has led to sig-nificant progress in automating prediction by learning the featuresthemselves. However, present approaches are largely insensitive tolocal patterns unique to networks.

Here we propose node2vec , an algorithmic framework for learn-ing feature representations for nodes in networks. In node2vec , welearn a mapping of nodes to a low-dimensional space of featuresthat maximizes the likelihood of preserving distances between net-work neighborhoods of nodes. We define a flexible notion of node’snetwork neighborhood and design a biased random walk proce-dure, which efficiently explores diverse neighborhoods and leads torich feature representations. Our algorithm generalizes prior workwhich is based on rigid notions of network neighborhoods and wedemonstrate that the added flexibility in exploring neighborhoodsis the key to learning richer representations.

We demonstrate the efficacy of node2vec over existing state-of-the-art techniques on multi-label classification and link predic-tion in several real-world networks from diverse domains. Takentogether, our work represents a new way for efficiently learningstate-of-the-art task-independent node representations in complexnetworks.

Categories and Subject Descriptors: H.2.8 [Database Manage-ment]: Database applications—Data mining; I.2.6 [Artificial In-telligence]: LearningGeneral Terms: Algorithms; Experimentation.Keywords: Information networks, Feature learning, Node embed-dings.

1. INTRODUCTIONMany important tasks in network analysis involve some kind of

prediction over nodes and edges. In a typical node classificationtask, we are interested in predicting the most probable labels ofnodes in a network [9, 38]. For example, in a social network, wemight be interested in predicting interests of users, or in a protein-protein interaction network we might be interested in predictingfunctional labels of proteins [29, 43]. Similarly, in link prediction,we wish to predict whether a pair of nodes in a network shouldhave an edge connecting them [20]. Link prediction is useful ina wide variety of domains, for instance, in genomics, it helps usdiscover novel interactions between genes and in social networks,it can identify real-world friends [2, 39].

Any supervised machine learning algorithm requires a set of in-put features. In prediction problems on networks this means thatone has to construct a feature vector representation for the nodes

u

s3

s2 s1

s4

s8

s9

s6

s7

s5

BFS

DFS

Figure 1: BFS and DFS search strategies from node u (k = 3).

and edges. A typical solution involves hand-engineering domain-specific features based on expert knowledge. Even if one discountsthe tedious work of feature engineering, such features are usuallydesigned for specific tasks and do not generalize across differentprediction tasks.

An alternative approach is to use data to learn feature represen-tations themselves [4]. The challenge in feature learning is defin-ing an objective function, which involves a trade-off in balancingcomputational efficiency and predictive accuracy. On one side ofthe spectrum, one could directly aim to find a feature representationthat optimizes performance of a downstream prediction task. Whilethis supervised procedure results in good accuracy, it comes at thecost of high training time complexity due to a blowup in the numberof parameters that need to be estimated. At the other extreme, theobjective function can be defined to be independent of the down-stream prediction task and the representation can be learned in apurely unsupervised way. This makes the optimization computa-tionally efficient and with a carefully designed objective, it resultsin task-independent features that match task-specific approaches inpredictive accuracy [25, 27].

However, current techniques fail to satisfactorily define and opti-mize a reasonable objective required for scalable unsupervised fea-ture learning in networks. Classic approaches based on linear andnon-linear dimensionality reduction techniques such as PrincipalComponent Analysis, Multi-Dimensional Scaling and their exten-sions [3, 31, 35, 41] invariably involve eigendecomposition of arepresentative data matrix which is expensive for large real-worldnetworks. Moreover, the resulting latent representations give poorperformance on various prediction tasks over networks.

Neural networks provide an alternative approach to unsupervisedfeature learning [15]. Recent attempts in this direction [28, 32]propose efficient algorithms but are largely insensitive to patternsunique to networks. Specifically, nodes in networks could be or-ganized based on communities they belong to (i.e., homophily); inother cases, the organization could be based on the structural rolesof nodes in the network (i.e., structural equivalence) [7, 11, 40,42]. For instance, in Figure 1, we observe nodes u and s1 belong-ing to the same community exhibit homophily, while the hub nodesu and s6 in the two communities are structurally equivalent. Real-

14

𝑁PQ+ 𝑢 = {𝑠T, 𝑠U, 𝑠V}

𝑁XQ+ 𝑢 = {𝑠Y, 𝑠Z, 𝑠[}Local microscopic viewGlobal macroscopic view

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 15: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

BFS:Micro-view of

neighbourhood

u

DFS:Macro-view of neighbourhood

15JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 16: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Biasedrandomwalk𝑆 thatgivenanode𝑢generatesneighborhood𝑁+ 𝑢¡ Twoparameters:§ Returnparameter𝑝:

§ Returnbacktothepreviousnode

§ In-outparameter𝑞:§ Movingoutwards(DFS)vs.inwards(BFS)

16JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 17: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

𝑵𝑺(𝒖):Biased2nd-orderrandomwalksexplorenetworkneighborhoods:

§ BFS-like:lowvalueof𝑝§ DFS-like:lowvalueof𝑞

𝑝, 𝑞 canlearnedinasemi-supervisedway

u → s4 → ? us1s5

u

s1

s4

s51

1/q

1/p

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 1712/4/17

Page 18: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ 1)Computerandomwalkprobs.¡ 2)Simulate𝑟 randomwalksoflength𝑙 startingfromeachnodeu

¡ 3) Optimizethenode2vecobjectiveusingStochasticGradientDescent

Linear-timecomplexity.All3stepsareindividuallyparallelizable

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 1812/4/17

Page 19: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Interactionsofcharactersinanovel:

Figure 3: Complementary visualizations of Les Misérables co-appearance network generated by node2vec with label colorsreflecting homophily (top) and structural equivalence (bottom).

also exclude a recent approach, GraRep [6], that generalizes LINEto incorporate information from network neighborhoods beyond 2-hops, but does not scale and hence, provides an unfair comparisonwith other neural embedding based feature learning methods. Apartfrom spectral clustering which has a slightly higher time complex-ity since it involves matrix factorization, our experiments stand outfrom prior work in the sense that all other comparison benchmarksare evaluated in settings that equalize for runtime. In doing so, wediscount for performance gain observed purely because of the im-plementation language (C/C++/Python) since it is secondary to thealgorithm. In order to create fair and reproducible comparisons, wenote that the runtime complexity is contributed from two distinctphases: sampling and optimization.

In the sampling phase, all benchmarks as well as node2vec pa-rameters are set such that they generate equal samples at runtime.As an example, if K is the overall sample constraint, then the node2vecparameters satisfy K = r · l · |V |. In the optimization phase,all benchmarks optimize using a stochastic gradient descent algo-rithm with two key differences that we correct for. First, DeepWalkuses hierarchical sampling to approximate the softmax probabilitieswith an objective similar to the one use by node2vec in (2). How-ever, hierarchical softmax is inefficient when compared with neg-ative sampling [26]. Hence, keeping everything else the same, weswitch to negative sampling in DeepWalk which is also the de factoapproximation in node2vec and LINE. Second, both node2vec andDeepWalk have a parameter (k) for the number of context neigh-borhood nodes to optimize for and the greater the number, the morerounds of optimization are required. This parameter is set to unityfor LINE. Since LINE completes a single epoch quicker than otherapproaches, we let it run for k epochs.

The parameter settings used for node2vec are in line with typ-ical values used for DeepWalk and LINE. Specifically, d = 128,r = 10, l = 80, k = 10 and the optimization is run for a singleepoch. (Following prior work [34], we use d = 500 for spec-tral clustering.) All results for all tasks are statistically significantwith a p-value of less than 0.01.The best in-out and return hyperpa-rameters were learned using 10-fold cross-validation on just 10%

Algorithm DatasetBlogCatalog PPI Wikipedia

Spectral Clustering 0.0405 0.0681 0.0395DeepWalk 0.2110 0.1768 0.1274LINE 0.0784 0.1447 0.1164node2vec 0.2581 0.1791 0.1552node2vec settings (p,q) 0.25, 0.25 4, 1 4, 0.5Gain of node2vec [%] 22.3 1.3 21.8

Table 2: Macro-F1 scores for multilabel classification on Blog-Catalog, PPI (Homo sapiens) and Wikipedia word cooccur-rence networks with a balanced 50% train-test split.

labeled data with a grid search over p, q 2 {0.25, 0.50, 1, 2, 4}.Under the above experimental settings, we present our results fortwo tasks under consideration.

4.3 Multi-label classificationIn the multi-label classification setting, every node is assigned

one or more labels from a finite set L. During the training phase, weobserve a certain fraction of nodes and all their labels. The task isto predict the labels for the remaining nodes. This is a challengingtask especially if L is large. We perform multi-label classificationon the following datasets:

• BlogCatalog [44]: This is a network of social relationshipsof the bloggers listed on the BlogCatalog website. The la-bels represent blogger interests inferred through the meta-data provided by the bloggers. The network has 10,312 nodes,333,983 edges and 39 different labels.

• Protein-Protein Interactions (PPI) [5]: We use a subgraphof the PPI network for Homo Sapiens. The subgraph cor-responds to the graph induced by nodes for which we couldobtain labels from the hallmark gene sets [21] and representbiological states. The network has 3,890 nodes, 76,584 edgesand 50 different labels.

• Wikipedia Cooccurrences [23]: This is a cooccurrence net-work of words appearing in the first million bytes of theWikipedia dump. The labels represent the Part-of-Speech(POS) tags as listed in the Penn Tree Bank [24] and inferredusing the Stanford POS-Tagger [37]. The network has 4,777nodes, 184,812 edges and 40 different labels.

All our networks exhibit a fair mix of homophilic and structuralequivalences. For example, we would expect the social networkof bloggers to exhibit strong homophily-based relationships, how-ever, there might also be some ‘familiar strangers’, that is, bloggersthat do not interact but share interests and hence are structurallyequivalent nodes. The biological states of proteins in a protein-protein interaction network also exhibit both types of equivalences.For example, they exhibit structural equivalence when proteins per-form functions complementary to those of neighboring proteins,and at other times, they organize based on homophily in assistingneighboring proteins in performing similar functions. The word co-occurence network is fairly dense, since edges exist between wordscooccuring in a 2-length window in the Wikipedia corpus. Hence,words having the same POS tags are not hard to find, lending a highdegree of homophily. At the same time, we expect some structuralequivalence in the POS tags due to syntactic grammar rules such asdeterminers following nouns, punctuations preceeding nouns etc.

Experimental results. The learned node feature representationsare input to a one-vs-rest logistic regression using the LIBLINEARimplementation with L2 regularization. The train and test data issplit equally over 10 random splits. We use the Macro-F1 scoresfor comparing performance in Table 2 and the relative performance

Figure 3: Complementary visualizations of Les Misérables co-appearance network generated by node2vec with label colorsreflecting homophily (top) and structural equivalence (bottom).

also exclude a recent approach, GraRep [6], that generalizes LINEto incorporate information from network neighborhoods beyond 2-hops, but does not scale and hence, provides an unfair comparisonwith other neural embedding based feature learning methods. Apartfrom spectral clustering which has a slightly higher time complex-ity since it involves matrix factorization, our experiments stand outfrom prior work in the sense that all other comparison benchmarksare evaluated in settings that equalize for runtime. In doing so, wediscount for performance gain observed purely because of the im-plementation language (C/C++/Python) since it is secondary to thealgorithm. In order to create fair and reproducible comparisons, wenote that the runtime complexity is contributed from two distinctphases: sampling and optimization.

In the sampling phase, all benchmarks as well as node2vec pa-rameters are set such that they generate equal samples at runtime.As an example, if K is the overall sample constraint, then the node2vecparameters satisfy K = r · l · |V |. In the optimization phase,all benchmarks optimize using a stochastic gradient descent algo-rithm with two key differences that we correct for. First, DeepWalkuses hierarchical sampling to approximate the softmax probabilitieswith an objective similar to the one use by node2vec in (2). How-ever, hierarchical softmax is inefficient when compared with neg-ative sampling [26]. Hence, keeping everything else the same, weswitch to negative sampling in DeepWalk which is also the de factoapproximation in node2vec and LINE. Second, both node2vec andDeepWalk have a parameter (k) for the number of context neigh-borhood nodes to optimize for and the greater the number, the morerounds of optimization are required. This parameter is set to unityfor LINE. Since LINE completes a single epoch quicker than otherapproaches, we let it run for k epochs.

The parameter settings used for node2vec are in line with typ-ical values used for DeepWalk and LINE. Specifically, d = 128,r = 10, l = 80, k = 10 and the optimization is run for a singleepoch. (Following prior work [34], we use d = 500 for spec-tral clustering.) All results for all tasks are statistically significantwith a p-value of less than 0.01.The best in-out and return hyperpa-rameters were learned using 10-fold cross-validation on just 10%

Algorithm DatasetBlogCatalog PPI Wikipedia

Spectral Clustering 0.0405 0.0681 0.0395DeepWalk 0.2110 0.1768 0.1274LINE 0.0784 0.1447 0.1164node2vec 0.2581 0.1791 0.1552node2vec settings (p,q) 0.25, 0.25 4, 1 4, 0.5Gain of node2vec [%] 22.3 1.3 21.8

Table 2: Macro-F1 scores for multilabel classification on Blog-Catalog, PPI (Homo sapiens) and Wikipedia word cooccur-rence networks with a balanced 50% train-test split.

labeled data with a grid search over p, q 2 {0.25, 0.50, 1, 2, 4}.Under the above experimental settings, we present our results fortwo tasks under consideration.

4.3 Multi-label classificationIn the multi-label classification setting, every node is assigned

one or more labels from a finite set L. During the training phase, weobserve a certain fraction of nodes and all their labels. The task isto predict the labels for the remaining nodes. This is a challengingtask especially if L is large. We perform multi-label classificationon the following datasets:

• BlogCatalog [44]: This is a network of social relationshipsof the bloggers listed on the BlogCatalog website. The la-bels represent blogger interests inferred through the meta-data provided by the bloggers. The network has 10,312 nodes,333,983 edges and 39 different labels.

• Protein-Protein Interactions (PPI) [5]: We use a subgraphof the PPI network for Homo Sapiens. The subgraph cor-responds to the graph induced by nodes for which we couldobtain labels from the hallmark gene sets [21] and representbiological states. The network has 3,890 nodes, 76,584 edgesand 50 different labels.

• Wikipedia Cooccurrences [23]: This is a cooccurrence net-work of words appearing in the first million bytes of theWikipedia dump. The labels represent the Part-of-Speech(POS) tags as listed in the Penn Tree Bank [24] and inferredusing the Stanford POS-Tagger [37]. The network has 4,777nodes, 184,812 edges and 40 different labels.

All our networks exhibit a fair mix of homophilic and structuralequivalences. For example, we would expect the social networkof bloggers to exhibit strong homophily-based relationships, how-ever, there might also be some ‘familiar strangers’, that is, bloggersthat do not interact but share interests and hence are structurallyequivalent nodes. The biological states of proteins in a protein-protein interaction network also exhibit both types of equivalences.For example, they exhibit structural equivalence when proteins per-form functions complementary to those of neighboring proteins,and at other times, they organize based on homophily in assistingneighboring proteins in performing similar functions. The word co-occurence network is fairly dense, since edges exist between wordscooccuring in a 2-length window in the Wikipedia corpus. Hence,words having the same POS tags are not hard to find, lending a highdegree of homophily. At the same time, we expect some structuralequivalence in the POS tags due to syntactic grammar rules such asdeterminers following nouns, punctuations preceeding nouns etc.

Experimental results. The learned node feature representationsare input to a one-vs-rest logistic regression using the LIBLINEARimplementation with L2 regularization. The train and test data issplit equally over 10 random splits. We use the Macro-F1 scoresfor comparing performance in Table 2 and the relative performance

p=1, q=2Microscopic view of the network neighbourhood

p=1, q=0.5Macroscopic view of the network neighbourhood

19JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 20: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

20JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 21: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

0.0 0.1 0.2 0.3 0.4 0.5 0.6

Fraction of missing edges

0.00

0.05

0.10

0.15

0.20

Mac

ro-F

1sc

ore

0.0 0.1 0.2 0.3 0.4 0.5 0.6

Fraction of additional edges

0.00

0.05

0.10

0.15

0.20

Mac

ro-F

1sc

ore

21JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 22: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

General-purposefeaturelearninginnetworks:¡ Anexplicitlocalitypreservingobjectiveforfeaturelearning.

¡ Biasedrandomwalkscapturediversityofnetworkpatterns.

¡ Scalableandrobustalgorithmwithexcellentempiricalperformance.

¡ Futureextensionswouldinvolvedesigningrandomwalkstrategiesentailedtonetworkwithspecificstructuresuchasheterogeneousnetworksandsignednetworks.

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 22

Page 23: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

23

OhmNet: Extension to Hierarchical Networks

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 24: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Let’sgeneralizenode2vectomultilayernetworks!

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 2412/4/17

Page 25: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Eachnetworkisalayer𝐺A = (𝑉A, 𝐸A)¡ Similaritiesbetweenlayersaregiveninhierarchyℳ,map𝜋 encodes parent-childrelationships

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 2512/4/17

Page 26: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Computationalframeworkthatlearnsfeaturesofeverynodeandateveryscalebasedon:§ Edgeswithineachlayer§ Inter-layerrelationshipsbetweennodesactive

ondifferentlayers

26JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 27: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

27

InputOutput: embeddings of nodes in layers as well as

internal levels of the hierarchy

𝐺A 𝐺e

𝐺f 𝐺g

2

3

1

Page 28: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

• OhmNet: GivenlayersGi andhierarchyM,learnnodefeaturescapturedbyfunctionsfi

• Functionsfi embedeverynodeinad-dimensionalfeaturespace

28

A multi-layer network with four layers and a two-level hierarchy M

Page 29: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Given:Layers 𝐺A ,hierarchyℳ§ Layers 𝐺A AhT..j areinleavesofℳ

¡ Goal:Learnfunctions:𝑓A: 𝑉A →ℝ&

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 2912/4/17

Page 30: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Approachhastwocomponents:§ Per-layerobjectives:Nodeswithsimilarnetworkneighborhoods ineachlayerareembeddedclosetogether

§ Hierarchicaldependencyobjectives:Nodesinnearbylayersinhierarchyareencouragedtosharesimilarfeatures

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 3012/4/17

Page 31: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Intuition: Foreachlayer,findamappingofnodesto𝑑-dimensionsthatpreservesnodesimilarity

¡ Approach:Similarityofnodes𝑢 and𝑣 isdefinedbasedonsimilarityoftheirnetworkneighborhoods

¡ Givennode𝑢 inlayer𝑖 wedefinenearbynodes𝑁A(𝑢) basedonrandomwalksstartingatnode𝑢

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 3112/4/17

Page 32: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Givennode𝑢 inlayer𝑖,learn𝑢’srepresentationsuchthatitpredictsnearbynodes𝑁A(𝑢):

¡ Given𝑇 layers,maximize:

¡ Notice: Nodesindifferentnetworksrepresentingthesameentityhavedifferentfeatures

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 32

Predicting multicellular function through multi-layer tissue networks 3

neural network embedding based approaches. In matrix factorization,a network is expressed as a data matrix where the entries representrelationships. The data matrix is projected to a low dimensional spaceusing linear techniques based on SVD (Tang et al., 2012), or non-lineartechniques based on multi-dimensional scaling (Tenenbaum et al., 2000;Belkin and Niyogi, 2001; Hou et al., 2014). These methods have twoimportant drawbacks. First, they do not account for important structurestypically exhibited in networks such as high sparsity and skewed degreedistribution. Second, matrix factorization methods perform a globalfactorization of the data matrix while a local-centric method might oftenyield more useful feature representations (Kramer et al., 2014).

Limitations of matrix factorization are overcome by neural networkembeddings. Recent studies focused on embedding nodes into low-dimensional vector spaces by first using random walks to construct thenetwork neighborhood of every node in the graph, and then optimizing anobjective function with network neighborhoods as input (Perozzi et al.,2014; Tang et al., 2015; Grover and Leskovec, 2016). The objectivefunction is carefully designed to preserve both the local and global networkstructures. A state-of-the-art neural network embedding algorithm is theNode2vec algorithm (Grover and Leskovec, 2016), which learns featurerepresentations as follows: it scans over the nodes in a network, and forevery node it aims to embed it such that the node’s features can predictnearby nodes, that is, node’s feature predict which other nodes are partof its network neighborhood. Node2vec can explore different networkneighborhoods to embed nodes based on the principles of homophily (i.e.,network communities) as well as structural equivalence (i.e., structuralroles of nodes).

A challenging problem for neural network embedding-based methodsis to learn features in multi-layer networks. Existing methods can learnfeatures in multi-layer networks either by treating each layer independentlyof other layers, or by aggregating the layers into a single (weighted)network. However, neglecting the existence of multiple layers oraggregating the layers into a single network, alters topological propertiesof the system as well as the importance of individual nodes with respect tothe entire network structure (De Domenico et al., 2016). This is a majorshortcoming of prior work that can lead to a wrong identification of themost versatile nodes (De Domenico et al., 2015) and overestimation ofthe importance of more marginal nodes (De Domenico et al., 2014). Aswe shall show, this shortcoming also affects predictive accuracy of thelearned features. Our approach OhmNet overcomes this limitation since itlearns features in a multi-layer network in the context of the entire systemstructure, bridging together different layers and generalizing methodsdeveloped for learning features in single-layer networks (Section 3).

Finally, there exists recent work for task-dependent feature learningbased on graph-specific deep network architectures (Zhai and Zhang,2015; Li et al., 2015; Xiaoyi et al., 2014; Wang et al., 2016a). Ourapproach differs from those approaches in two important ways. First,those architectures are task-dependent, meaning they directly optimizethe objective function for a downstream prediction task, such as cellularfunction prediction in a particular tissue, using several layers of non-lineartransformations. Second, those architectures do not model rich graphstructures, such as multi-layer graphs with hierarchies.

3 Hierarchy-aware feature learning in

multi-layer networks

We formulate feature learning in multi-layer networks with hierarchicaldependencies as a maximum likelihood optimization problem. Let V be agiven set ofN nodes (e.g., proteins) {u1, u2, . . . , uN}, and let there beT

types of edges (e.g., protein interactions in different tissues) between pairsof nodes u1, u2, . . . , uN . A multi-layer network is a general system inwhich each biological context is represented by a distinct layer i (wherei = 1, 2, . . . , T ) of a system (Figure 1). We use the term single-layer

network (layer) for the network Gi = (Vi, Ei) that indicates the edgesEi between nodesVi ✓ V within the same layer i. Our analysis is generaland applies to any (un)directed, (un)weighted multi-layer network.

We take into account the possibility that a node uk from layer i can berelated to any other node uh in any other layer j. We encode informationabout the dependencies between layers in a hierarchical manner that we usein the learning process. Let the hierarchy be a directed treeM defined overa setM of objects by the parent-child relationships given by⇡ : M ! M,

where ⇡(i) is the parent of object i (Figure 1). For convenience, let Ci

denote the set of all children of object i in the hierarchy. Let T ⇢ M bethe set of all leaf objects in the hierarchy. We assume that each layer Gi isattached to one leaf object in the hierarchy. As a result, the hierarchy hasexactly T leaf objects.

The problem of feature learning in a multi-layer network is to learnfunctions f1, f2, . . . , fT , such that each function fi : Vi ! Rd mapsnodes in Vi to feature representations in Rd. Here, d is a parameterspecifying the number of dimensions in the feature representation of onenode. Equivalently, fi is a matrix of |Vi|⇥ d parameters.

We proceed by describing OhmNet, our approach for feature learningin multi-layer networks. OhmNet has two components:

• single-layer network objectives, in which nodes with similar networkneighborhoods in each layer are encouraged to share similar features,and

• hierarchical dependency objective, in which nodes in nearby layersin the hierarchy are encouraged to share similar features.

We start by describing the model that considers the layers independentlyof each other. We then extend the model to encourage nodes which arenearby in the hierarchy to have similar features.

3.1 Single-layer network objectives

We start by formalizing the intuition that nodes with similar networkneighborhoods in each layer should share similar features. For that, wespecify one objective for each layer in a given multi-layer network. Weshall later discuss how OhmNet incorporates the dependencies betweendifferent layers.

Our goal is to take layer Gi and learn fi which embeds nodes fromsimilar network regions, or nodes with similar structural roles, closelytogether. In OhmNet, we aim to achieve this goal by specifying thefollowing objective function for each layer Gi. Given a node u 2 Vi,the objective function !i seeks to predict, which nodes are members ofu’s network neighborhood Ni(u) based on the learned node features fi:

!i(u) = logPr(Ni(u)|fi(u)), (1)

where the conditional likelihood of every node-neighborhood node pairis modeled as an independent softmax unit parameterized by a dotproduct of nodes’ features, which corresponds to a single-layer feed-forward neural network (Grover and Leskovec, 2016). Given a nodeu, maximization of !i(u) tries to maximize classification of nodes inu’s network neighborhood based on u’s learned representation. Moreprecisely, we use each current node as an input to a log-linear classifier,and predict nodes that are in the neighborhood of the current node.

The objective ⌦i is defined for each layer i:

⌦i =X

u2Vi

!i(u), for i = 1, 2, . . . , T. (2)for

Predicting multicellular function through multi-layer tissue networks 3

neural network embedding based approaches. In matrix factorization,a network is expressed as a data matrix where the entries representrelationships. The data matrix is projected to a low dimensional spaceusing linear techniques based on SVD (Tang et al., 2012), or non-lineartechniques based on multi-dimensional scaling (Tenenbaum et al., 2000;Belkin and Niyogi, 2001; Hou et al., 2014). These methods have twoimportant drawbacks. First, they do not account for important structurestypically exhibited in networks such as high sparsity and skewed degreedistribution. Second, matrix factorization methods perform a globalfactorization of the data matrix while a local-centric method might oftenyield more useful feature representations (Kramer et al., 2014).

Limitations of matrix factorization are overcome by neural networkembeddings. Recent studies focused on embedding nodes into low-dimensional vector spaces by first using random walks to construct thenetwork neighborhood of every node in the graph, and then optimizing anobjective function with network neighborhoods as input (Perozzi et al.,2014; Tang et al., 2015; Grover and Leskovec, 2016). The objectivefunction is carefully designed to preserve both the local and global networkstructures. A state-of-the-art neural network embedding algorithm is theNode2vec algorithm (Grover and Leskovec, 2016), which learns featurerepresentations as follows: it scans over the nodes in a network, and forevery node it aims to embed it such that the node’s features can predictnearby nodes, that is, node’s feature predict which other nodes are partof its network neighborhood. Node2vec can explore different networkneighborhoods to embed nodes based on the principles of homophily (i.e.,network communities) as well as structural equivalence (i.e., structuralroles of nodes).

A challenging problem for neural network embedding-based methodsis to learn features in multi-layer networks. Existing methods can learnfeatures in multi-layer networks either by treating each layer independentlyof other layers, or by aggregating the layers into a single (weighted)network. However, neglecting the existence of multiple layers oraggregating the layers into a single network, alters topological propertiesof the system as well as the importance of individual nodes with respect tothe entire network structure (De Domenico et al., 2016). This is a majorshortcoming of prior work that can lead to a wrong identification of themost versatile nodes (De Domenico et al., 2015) and overestimation ofthe importance of more marginal nodes (De Domenico et al., 2014). Aswe shall show, this shortcoming also affects predictive accuracy of thelearned features. Our approach OhmNet overcomes this limitation since itlearns features in a multi-layer network in the context of the entire systemstructure, bridging together different layers and generalizing methodsdeveloped for learning features in single-layer networks (Section 3).

Finally, there exists recent work for task-dependent feature learningbased on graph-specific deep network architectures (Zhai and Zhang,2015; Li et al., 2015; Xiaoyi et al., 2014; Wang et al., 2016a). Ourapproach differs from those approaches in two important ways. First,those architectures are task-dependent, meaning they directly optimizethe objective function for a downstream prediction task, such as cellularfunction prediction in a particular tissue, using several layers of non-lineartransformations. Second, those architectures do not model rich graphstructures, such as multi-layer graphs with hierarchies.

3 Hierarchy-aware feature learning in

multi-layer networks

We formulate feature learning in multi-layer networks with hierarchicaldependencies as a maximum likelihood optimization problem. Let V be agiven set ofN nodes (e.g., proteins) {u1, u2, . . . , uN}, and let there beT

types of edges (e.g., protein interactions in different tissues) between pairsof nodes u1, u2, . . . , uN . A multi-layer network is a general system inwhich each biological context is represented by a distinct layer i (wherei = 1, 2, . . . , T ) of a system (Figure 1). We use the term single-layer

network (layer) for the network Gi = (Vi, Ei) that indicates the edgesEi between nodesVi ✓ V within the same layer i. Our analysis is generaland applies to any (un)directed, (un)weighted multi-layer network.

We take into account the possibility that a node uk from layer i can berelated to any other node uh in any other layer j. We encode informationabout the dependencies between layers in a hierarchical manner that we usein the learning process. Let the hierarchy be a directed treeM defined overa setM of objects by the parent-child relationships given by⇡ : M ! M,

where ⇡(i) is the parent of object i (Figure 1). For convenience, let Ci

denote the set of all children of object i in the hierarchy. Let T ⇢ M bethe set of all leaf objects in the hierarchy. We assume that each layer Gi isattached to one leaf object in the hierarchy. As a result, the hierarchy hasexactly T leaf objects.

The problem of feature learning in a multi-layer network is to learnfunctions f1, f2, . . . , fT , such that each function fi : Vi ! Rd mapsnodes in Vi to feature representations in Rd. Here, d is a parameterspecifying the number of dimensions in the feature representation of onenode. Equivalently, fi is a matrix of |Vi|⇥ d parameters.

We proceed by describing OhmNet, our approach for feature learningin multi-layer networks. OhmNet has two components:

• single-layer network objectives, in which nodes with similar networkneighborhoods in each layer are encouraged to share similar features,and

• hierarchical dependency objective, in which nodes in nearby layersin the hierarchy are encouraged to share similar features.

We start by describing the model that considers the layers independentlyof each other. We then extend the model to encourage nodes which arenearby in the hierarchy to have similar features.

3.1 Single-layer network objectives

We start by formalizing the intuition that nodes with similar networkneighborhoods in each layer should share similar features. For that, wespecify one objective for each layer in a given multi-layer network. Weshall later discuss how OhmNet incorporates the dependencies betweendifferent layers.

Our goal is to take layer Gi and learn fi which embeds nodes fromsimilar network regions, or nodes with similar structural roles, closelytogether. In OhmNet, we aim to achieve this goal by specifying thefollowing objective function for each layer Gi. Given a node u 2 Vi,the objective function !i seeks to predict, which nodes are members ofu’s network neighborhood Ni(u) based on the learned node features fi:

!i(u) = logPr(Ni(u)|fi(u)), (1)

where the conditional likelihood of every node-neighborhood node pairis modeled as an independent softmax unit parameterized by a dotproduct of nodes’ features, which corresponds to a single-layer feed-forward neural network (Grover and Leskovec, 2016). Given a nodeu, maximization of !i(u) tries to maximize classification of nodes inu’s network neighborhood based on u’s learned representation. Moreprecisely, we use each current node as an input to a log-linear classifier,and predict nodes that are in the neighborhood of the current node.

The objective ⌦i is defined for each layer i:

⌦i =X

u2Vi

!i(u), for i = 1, 2, . . . , T. (2)

12/4/17

Page 33: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Sofar,wedidnotconsiderhierarchyℳ¡ Noderepresentationsindifferentlayersarelearnedindependentlyofeachother

Howtomodeldependenciesbetweenlayerswhenlearningnodefeatures?

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 3312/4/17

Page 34: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Weuseregularizationtoshareinformationacrossthehierarchy

¡ Wewanttoenforcesimilaritybetweenfeaturerepresentationsofnetworksthatarelocatednearbyinthehierarchy

3412/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Page 35: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Givennode𝑢,learn𝑢’srepresentationinlayer𝑖 tobecloseto𝑢’srepresentationinparent𝜋(𝑖):

¡ Multi-scale:Repeatateverylevelofℳ

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 35

4 Zitnik & Leskovec

The objective is inspired by the intuition that nodes with similar networkneighborhoods tend to have similar meanings, or roles, in a network.It formalizes this intuition by encouraging nodes in similar networkneighborhoods to share similar features.

We found that a flexible notion of a network neighborhoodNi is crucialto achieve excellent predictive accuracy on a downstream cellular functionprediction task (Grover and Leskovec, 2016). For that reason, we use arandomized procedure to sample many different neighborhoods of a givennode u. Technically, the network neighborhood Ni(u) is a set of nodesthat appear in an appropriately biased random walk defined on layer Gi

and started at node u (Grover and Leskovec, 2016). The neighborhoodsNi(u) are not restricted to just immediate neighbors but can have vastlydifferent structures depending on the sampling strategy.

Next, we expand OhmNet’s single-layer network objectives to leverageinformation provided by the tissue taxonomy and this way informembeddings across different layers.

3.2 Hierarchical dependency objective

So far, we specified T layer-by-layer objectives each of which estimatesnode features in its layer independently of node features in other layers.This means that nodes in different layers representing the same entity havefeatures that are learned independently of each other.

To harness the dependencies between the layers, we expand OhmNet

with terms that encourage sharing of protein features between the layers.Our approach is based on the assumption that nearby layers in thehierarchy are semantically close to each other and hence proteins/nodesin them should share similar features. For example, in the tissue multi-layer network, we model the fact that the “medulla” layer is part of the“brainstem” layer, which is, in turn, part of the “brain” layer. We use thedependencies among the layers to define a joint objective for regularizationof the learned features of proteins.

We propose to use the hierarchy in the learning process byincorporating a recursive structure into the regularization term for everyobject in the hierarchy. Specifically, we propose the following form ofregularization for node u that resides in hierarchy i:

ci(u) =1

2kfi(u)� f⇡(i)(u)k22. (3)

This recursive form of regularization enforces the features of node u inthe hierarchy i to be similar to the features of node u in i’s parent ⇡(i)under the Euclidean norm. When regularizing features of all nodes in theelements i of the hierarchy, we obtain:

Ci =X

u2Li

ci(u), (4)

where Li = Vi if i 2 T is a leaf object in the hierarchy, and otherwiseLi = [j2TiVj . Here, Ti denotes the set of leaf objects in the sub-hierarchy rooted at i. In words, we specify the features for both leaf as wellas internal, i.e., non-leaf, objects in the hierarchy, and we regularize thefeatures of sibling (i.e., sharing the same parent) objects towards featuresin the common parent object in the hierarchy.

It is important to notice that OhmNet’s structured regularization allowsus to learn feature representations at multiple scales. For example, considera multi-layer network in Figure 2, consisting of four layers that areinterrelated by a two-level hierarchy. OhmNet learns the mappings fi, fj ,fk , and fl that map nodes in each layer into a d-dimensional feature space.Additionally, OhmNet also learns the mapping f2 representing featuresfor nodes V2 = Vi [ Vj at an intermediate scale, and the mapping f1

representing features for nodes V1 = Vi [ Vj [ Vk [ Vl at the highestscale.

Fig. 2: A multi-layer network with four layers. Relationships betweenthe layers are encoded by a two-level hierarchyM. Leaves of the hierarchycorrespond to the network layers. Given networks Gi and hierarchy M,OhmNet learns node embeddings captured by functions fi.

The modeling of relationships between layers in a multi-layer networkhas several implications:

• First, the model encourages nodes which are in nearby layers in thehierarchy to share similar features.

• Second, the model shares statistical strength across the hierarchy asnodes in different layers representing the same protein share featuresthrough ancestors in the hierarchy.

• Third, this model is more efficient than the fully pairwise model.In the fully pairwise model, the dependencies between layers aremodeled by pairwise comparisons of nodes across all pairs of layers,which takes O(T 2

N) time, where T is the number of layers andN is the number of nodes. In contrast, OhmNet models inter-layerdependencies according to the parent-child relationships specified bythe hierarchy, which takes only O(|M |N) time. Since OhmNet’shierarchy is a tree, it holds that |M | ⌧ T

2, meaning that the proposedmodel scales more easily to large multi-layer networks than the fullypairwise model.

• Finally, the hierarchy is a natural way to represent and model biologicalsystems spanning many different biological scales (Carvunis andIdeker, 2014; Greene et al., 2015; Yu et al., 2016).

3.3 Full OhmNet model

Given a multi-layer network consisting of layers G1, G2, . . . , GT , and ahierarchy encoding relationships between the layers, the OhmNet’s goalis to learn the functions f1, f2, . . . , fT that map from nodes in each layerto feature representations. OhmNet achieves this goal by fitting its featurelearning model to a given multi-layer network and a given hierarchy, i.e.,by finding the mapping functions f1, f2, . . . , fT that maximize the datalikelihood.

Given the data, OhmNet aims to solve the following maximumlikelihood optimization problem:

maxf1,f2,...,f|M|

X

i2T⌦i � �

X

j2MCj , (5)

which includes the single-layer network objectives for all network layers,and the hierarchical dependency objectives for all hierarchy objects.In Eq. (5), parameter � is a user-specified parameter representing the

4 Zitnik & Leskovec

The objective is inspired by the intuition that nodes with similar networkneighborhoods tend to have similar meanings, or roles, in a network.It formalizes this intuition by encouraging nodes in similar networkneighborhoods to share similar features.

We found that a flexible notion of a network neighborhoodNi is crucialto achieve excellent predictive accuracy on a downstream cellular functionprediction task (Grover and Leskovec, 2016). For that reason, we use arandomized procedure to sample many different neighborhoods of a givennode u. Technically, the network neighborhood Ni(u) is a set of nodesthat appear in an appropriately biased random walk defined on layer Gi

and started at node u (Grover and Leskovec, 2016). The neighborhoodsNi(u) are not restricted to just immediate neighbors but can have vastlydifferent structures depending on the sampling strategy.

Next, we expand OhmNet’s single-layer network objectives to leverageinformation provided by the tissue taxonomy and this way informembeddings across different layers.

3.2 Hierarchical dependency objective

So far, we specified T layer-by-layer objectives each of which estimatesnode features in its layer independently of node features in other layers.This means that nodes in different layers representing the same entity havefeatures that are learned independently of each other.

To harness the dependencies between the layers, we expand OhmNet

with terms that encourage sharing of protein features between the layers.Our approach is based on the assumption that nearby layers in thehierarchy are semantically close to each other and hence proteins/nodesin them should share similar features. For example, in the tissue multi-layer network, we model the fact that the “medulla” layer is part of the“brainstem” layer, which is, in turn, part of the “brain” layer. We use thedependencies among the layers to define a joint objective for regularizationof the learned features of proteins.

We propose to use the hierarchy in the learning process byincorporating a recursive structure into the regularization term for everyobject in the hierarchy. Specifically, we propose the following form ofregularization for node u that resides in hierarchy i:

ci(u) =1

2kfi(u)� f⇡(i)(u)k22. (3)

This recursive form of regularization enforces the features of node u inthe hierarchy i to be similar to the features of node u in i’s parent ⇡(i)under the Euclidean norm. When regularizing features of all nodes in theelements i of the hierarchy, we obtain:

Ci =X

u2Li

ci(u), (4)

where Li = Vi if i 2 T is a leaf object in the hierarchy, and otherwiseLi = [j2TiVj . Here, Ti denotes the set of leaf objects in the sub-hierarchy rooted at i. In words, we specify the features for both leaf as wellas internal, i.e., non-leaf, objects in the hierarchy, and we regularize thefeatures of sibling (i.e., sharing the same parent) objects towards featuresin the common parent object in the hierarchy.

It is important to notice that OhmNet’s structured regularization allowsus to learn feature representations at multiple scales. For example, considera multi-layer network in Figure 2, consisting of four layers that areinterrelated by a two-level hierarchy. OhmNet learns the mappings fi, fj ,fk , and fl that map nodes in each layer into a d-dimensional feature space.Additionally, OhmNet also learns the mapping f2 representing featuresfor nodes V2 = Vi [ Vj at an intermediate scale, and the mapping f1

representing features for nodes V1 = Vi [ Vj [ Vk [ Vl at the highestscale.

Fig. 2: A multi-layer network with four layers. Relationships betweenthe layers are encoded by a two-level hierarchyM. Leaves of the hierarchycorrespond to the network layers. Given networks Gi and hierarchy M,OhmNet learns node embeddings captured by functions fi.

The modeling of relationships between layers in a multi-layer networkhas several implications:

• First, the model encourages nodes which are in nearby layers in thehierarchy to share similar features.

• Second, the model shares statistical strength across the hierarchy asnodes in different layers representing the same protein share featuresthrough ancestors in the hierarchy.

• Third, this model is more efficient than the fully pairwise model.In the fully pairwise model, the dependencies between layers aremodeled by pairwise comparisons of nodes across all pairs of layers,which takes O(T 2

N) time, where T is the number of layers andN is the number of nodes. In contrast, OhmNet models inter-layerdependencies according to the parent-child relationships specified bythe hierarchy, which takes only O(|M |N) time. Since OhmNet’shierarchy is a tree, it holds that |M | ⌧ T

2, meaning that the proposedmodel scales more easily to large multi-layer networks than the fullypairwise model.

• Finally, the hierarchy is a natural way to represent and model biologicalsystems spanning many different biological scales (Carvunis andIdeker, 2014; Greene et al., 2015; Yu et al., 2016).

3.3 Full OhmNet model

Given a multi-layer network consisting of layers G1, G2, . . . , GT , and ahierarchy encoding relationships between the layers, the OhmNet’s goalis to learn the functions f1, f2, . . . , fT that map from nodes in each layerto feature representations. OhmNet achieves this goal by fitting its featurelearning model to a given multi-layer network and a given hierarchy, i.e.,by finding the mapping functions f1, f2, . . . , fT that maximize the datalikelihood.

Given the data, OhmNet aims to solve the following maximumlikelihood optimization problem:

maxf1,f2,...,f|M|

X

i2T⌦i � �

X

j2MCj , (5)

which includes the single-layer network objectives for all network layers,and the hierarchical dependency objectives for all hierarchy objects.In Eq. (5), parameter � is a user-specified parameter representing the

𝐿A has all layers appearing in sub-hierarchy rooted at 𝑖12/4/17

Page 36: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Nodesindifferentlayersrepresentingthesameentityhavethesamefeaturesinhierarchyancestors

¡ Welearnfeaturerepresentationsatmultiplescales:§ featuresofnodesinthelayers§ featuresofnodesinnon-leavesinthehierarchy

¡ Thismodelismoreefficientthanthefullypairwisemodel,wheredependenciesbetweenlayersaremodeledbypairwisecomparisonsofnodesacrossallpairsoflayers

3612/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Page 37: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

37

Learning node features in multi-layer networks

Solve maximum likelihood problem:

4 Zitnik & Leskovec

The objective is inspired by the intuition that nodes with similar networkneighborhoods tend to have similar meanings, or roles, in a network.It formalizes this intuition by encouraging nodes in similar networkneighborhoods to share similar features.

We found that a flexible notion of a network neighborhoodNi is crucialto achieve excellent predictive accuracy on a downstream cellular functionprediction task (Grover and Leskovec, 2016). For that reason, we use arandomized procedure to sample many different neighborhoods of a givennode u. Technically, the network neighborhood Ni(u) is a set of nodesthat appear in an appropriately biased random walk defined on layer Gi

and started at node u (Grover and Leskovec, 2016). The neighborhoodsNi(u) are not restricted to just immediate neighbors but can have vastlydifferent structures depending on the sampling strategy.

Next, we expand OhmNet’s single-layer network objectives to leverageinformation provided by the tissue taxonomy and this way informembeddings across different layers.

3.2 Hierarchical dependency objective

So far, we specified T layer-by-layer objectives each of which estimatesnode features in its layer independently of node features in other layers.This means that nodes in different layers representing the same entity havefeatures that are learned independently of each other.

To harness the dependencies between the layers, we expand OhmNet

with terms that encourage sharing of protein features between the layers.Our approach is based on the assumption that nearby layers in thehierarchy are semantically close to each other and hence proteins/nodesin them should share similar features. For example, in the tissue multi-layer network, we model the fact that the “medulla” layer is part of the“brainstem” layer, which is, in turn, part of the “brain” layer. We use thedependencies among the layers to define a joint objective for regularizationof the learned features of proteins.

We propose to use the hierarchy in the learning process byincorporating a recursive structure into the regularization term for everyobject in the hierarchy. Specifically, we propose the following form ofregularization for node u that resides in hierarchy i:

ci(u) =1

2kfi(u)� f⇡(i)(u)k22. (3)

This recursive form of regularization enforces the features of node u inthe hierarchy i to be similar to the features of node u in i’s parent ⇡(i)under the Euclidean norm. When regularizing features of all nodes in theelements i of the hierarchy, we obtain:

Ci =X

u2Li

ci(u), (4)

where Li = Vi if i 2 T is a leaf object in the hierarchy, and otherwiseLi = [j2TiVj . Here, Ti denotes the set of leaf objects in the sub-hierarchy rooted at i. In words, we specify the features for both leaf as wellas internal, i.e., non-leaf, objects in the hierarchy, and we regularize thefeatures of sibling (i.e., sharing the same parent) objects towards featuresin the common parent object in the hierarchy.

It is important to notice that OhmNet’s structured regularization allowsus to learn feature representations at multiple scales. For example, considera multi-layer network in Figure 2, consisting of four layers that areinterrelated by a two-level hierarchy. OhmNet learns the mappings fi, fj ,fk , and fl that map nodes in each layer into a d-dimensional feature space.Additionally, OhmNet also learns the mapping f2 representing featuresfor nodes V2 = Vi [ Vj at an intermediate scale, and the mapping f1

representing features for nodes V1 = Vi [ Vj [ Vk [ Vl at the highestscale.

Fig. 2: A multi-layer network with four layers. Relationships betweenthe layers are encoded by a two-level hierarchyM. Leaves of the hierarchycorrespond to the network layers. Given networks Gi and hierarchy M,OhmNet learns node embeddings captured by functions fi.

The modeling of relationships between layers in a multi-layer networkhas several implications:

• First, the model encourages nodes which are in nearby layers in thehierarchy to share similar features.

• Second, the model shares statistical strength across the hierarchy asnodes in different layers representing the same protein share featuresthrough ancestors in the hierarchy.

• Third, this model is more efficient than the fully pairwise model.In the fully pairwise model, the dependencies between layers aremodeled by pairwise comparisons of nodes across all pairs of layers,which takes O(T 2

N) time, where T is the number of layers andN is the number of nodes. In contrast, OhmNet models inter-layerdependencies according to the parent-child relationships specified bythe hierarchy, which takes only O(|M |N) time. Since OhmNet’shierarchy is a tree, it holds that |M | ⌧ T

2, meaning that the proposedmodel scales more easily to large multi-layer networks than the fullypairwise model.

• Finally, the hierarchy is a natural way to represent and model biologicalsystems spanning many different biological scales (Carvunis andIdeker, 2014; Greene et al., 2015; Yu et al., 2016).

3.3 Full OhmNet model

Given a multi-layer network consisting of layers G1, G2, . . . , GT , and ahierarchy encoding relationships between the layers, the OhmNet’s goalis to learn the functions f1, f2, . . . , fT that map from nodes in each layerto feature representations. OhmNet achieves this goal by fitting its featurelearning model to a given multi-layer network and a given hierarchy, i.e.,by finding the mapping functions f1, f2, . . . , fT that maximize the datalikelihood.

Given the data, OhmNet aims to solve the following maximumlikelihood optimization problem:

maxf1,f2,...,f|M|

X

i2T⌦i � �

X

j2MCj , (5)

which includes the single-layer network objectives for all network layers,and the hierarchical dependency objectives for all hierarchy objects.In Eq. (5), parameter � is a user-specified parameter representing the

Per-layer network

objectives

Hierarchical dependency objectives

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 38: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Proteinsareworkermolecules§ Understandingproteinfunctionhasgreatbiomedicalandpharmaceuticalimplications

¡ Functionofproteinsdependsontheirtissuecontext[Greeneetal.,NatGenet‘15]

38

G1G2

G3G4

12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Page 39: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Theprecisefunctionofproteinsdependsontheirtissuecontext(Greeneetal.,NatGenet2015)

¡ Diseasesresultfromthefailureoftissue-specificprocesses(Huetal.,NatRevGenet2016)

¡ Currentmodelsassumethatproteinfunctionsareconstantacrosstissues

39

Tissue-specific proteininteraction networks

G1G2

G3G4

Page 40: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Amulti-layertissuenetworkhasmanynetworklayers(tissues)

¡ Eachlayercorrespondstoonetissue-specificproteininteractionnetwork

¡ HierarchyMencodesbiologicalsimilaritiesbetweenthetissuesatmultiplescales

4012/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Page 41: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

107genome-widetissue-specificproteininteractionnetworks¡ 584tissue-specificcellularfunctions¡ Examples(tissue,cellularfunction):§ (renalcortex,cortexdevelopment)§ (artery,pulmonaryarterymorphogenesis)

41JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Frontallobe

Medullaoblongata

PonsSubstantianigra

Midbrain

Parietallobe

Occipitallobe

Temporallobe

Brainstem

Brain

Cerebellum

12/4/17

Page 42: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Frontallobe

Medullaoblongata

PonsSubstantianigra

Midbrain

Parietallobe

Occipitallobe

Temporallobe

Brainstem

Brain

Cerebellum

42

9 brain tissue PPI networksin two-level hierarchy

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 43: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

43JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu12/4/17

Page 44: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

¡ Cellularfunctionpredictionisamulti-labelnodeclassificationtask

¡ Everynode(protein)isassignedoneormorelabels(cellularfunctions)

¡ Setup:§ WeapplyOhmNet,whichforeverynodeineverylayerlearnsaseparatefeaturevectorinanunsupervisedway.

§ Foreverylayerandeveryfunctionwethentrainaseparateone-vs-allregularizedlinearclassifierusingthemodifiedHuberloss

§ Duringthetrainingphase,weobserveonlyacertainfractionofproteinsandalltheircellularfunctionsacrossthelayers

§ Thetaskisthentopredictthetissue-specificfunctionsfortheremainingproteins

4412/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu

Page 45: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Tissues12/4/17 JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 45

Page 46: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 46

¡ 42%improvementoverstate-of-the-artonthesamedataset

12/4/17

Page 47: CS224W: Analysis of Networks Jure Leskovec, ...snap.stanford.edu/class/cs224w-2017/slides/19-node2vec.pdf · rounds of optimization are required. This parameter is set to unity for

Transfer functionstounannotatedtissues¡ Task:Predictfunctionsintargettissuewithoutaccesstoanyannotation/labelinthattissue

JureLeskovec,StanfordCS224W:AnalysisofNetworks,http://cs224w.stanford.edu 47

Target tissue OhmNet Tissue non-specific

Improvement

Placenta 0.758 0.684 11%Spleen 0.779 0.712 10%Liver 0.741 0.553 34%Forebrain 0.755 0.632 20%Blood plasma 0.703 0.540 40%Smooth muscle 0.729 0.583 25%Average 0.746 0.617 21%

Reported are AUC values12/4/17