Learning Edge Representations via Low-Rank Asymmetric Projections
Sami Abu-El-Haija, Bryan Perozzi, Rami Al-Rfou
Prepared for ACM CIKM 2017, Singapore
1
Outline
2
Outline
3
Graph Embeddings -- What are they?
4
v1
v2
v3
v5
v4
v6
v11
v9
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
Outline
5
Graph Embeddings -- Why are they needed?
6
Outline
7
Graph Embedding -- How are they learned?
Where:
8
[1] Belkin & Niyogi. Laplacian eigenmaps and spectral techniques for embedding and clustering. NIPS 2001
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
9
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
10
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
v1
v2
v3
v5
v4
v6
v11
v9
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
11
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Random Walk
v1
v2
v3
v5
v4
v6
v11
v9
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
12
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Random Walk
v3 → v5 → v9 → v11 → v5 → ...
…
...
Random Walk Sequences
v1
v2
v3
v5
v4
v6
v11
v9
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
13
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Random Walk
v3 → v5 → v9 → v11 → v5 → ...
…
...
Random Walk Sequences
word2vec algorithm
v1
v2
v3
v5
v4
v6
v11
v9
Graph Embedding -- How are they learned?
Deep learning era brought Deepwalk [2]: simulates random walks then uses word2vec-style [3] learning to learn embeddings.
14
[2] Perozzi et al. DeepWalk: Online Learning of Social Representations. KDD 2014
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Random Walk
v3 → v5 → v9 → v11 → v5 → ...
…
...
Random Walk Sequences
word2vec algorithm
Embeddings Y
v1
v2
v3
v5
v4
v6
v11
v9
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
Graph Embedding -- How are they learned?
15
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Graph Embedding -- How are they learned?
16
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
v3 → v5 → v9 → v11 → v5 → ...
Random Walk Sequences
Embeddings Y
.v1
.v11
.v6
.v2
.v3
.v4
.v5
x
y
.v9
Graph Embedding -- How are they learned?
17
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
v3 → v5 → v9 → v11 → v5 → ...
Random Walk Sequences
Embeddings Y
anchor
node
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
Graph Embedding -- How are they learned?
18
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
v3 → v5 → v9 → v11 → v5 → ...
Random Walk Sequences
Embeddings Y
anchor
node
context node
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
Graph Embedding -- How are they learned?
19
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
v3 → v5 → v9 → v11 → v5 → ...
Random Walk Sequences
Embeddings Y
anchor
node
context node
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
Stochastic Update
Graph Embedding -- How are they learned?
E.g. increase
dot-product of embeddings
20
[3] Mikolov et al. Distributed Representations of Words and Phrases and their Compositionality. NIPS 2013
Outline
21
Weaknesses of existing methods
22
Outline
23
Our Method: TLDR
We extend existing methods in several ways:
24
Outline
25
Our Method: Model Architecture
26
v
Graph
u
Our Method: Model Architecture
27
v
Yv
Yu
u
Graph
Node
Embeddings
Our Method: Model Architecture
28
v
Yv
f
f(Yv)
Yu
f
f(Yu)
u
DNN
Node
Embeddings
Graph
Our Method: Model Architecture
29
v
Yv
f
f(Yv)
Yu
f
f(Yu)
u
DNN
Node
Embeddings
Graph
Our Method: Model Architecture
30
v
Yv
f
f(Yv)
T
R
Yu
f
f(Yu)
T
LT
u
DNN
Node
Embeddings
Graph
Low-Rank Asymmetric Projection
Our Method: Model Architecture
31
v
Yv
f
f(Yv)
T
R
Yu
f
f(Yu)
T
LT
u
DNN
Node
Embeddings
Low-Rank Asymmetric Projection
Dest
LTf(Yu)
Graph
Edge Representation
Source
Rf(Yv)
Our Method: Model Architecture
32
v
Yv
f
f(Yv)
T
R
Yu
f
f(Yu)
T
LT
σ(g(u, v))
u
DNN
Node
Embeddings
Low-Rank Asymmetric Projection
Source
Dest
LTf(Yu)
Rf(Yv)
Graph
Edge Likelihood
Edge Representation
Our Method: Model Architecture
33
v
Yv
f
f(Yv)
T
R
Yu
f
f(Yu)
T
LT
σ(g(u, v))
u
DNN
Node
Embeddings
Low-Rank Asymmetric Projection
Source
Dest
LTf(Yu)
Rf(Yv)
Graph
Edge Likelihood
Edge Representation
Left Embedding
(projection)
Right Embedding
(projection)
DeepWalk versus ours
DeepWalk [2]
Ours
34
Outline
35
Our Method: Graph Likelihood Derivation
36
Our Method: Graph Likelihood Derivation
37
Our Method: Graph Likelihood Derivation
38
Our Method: Graph Likelihood Derivation
39
Graph Likelihood
Non exclusive!
is frequence of u and v are co-visited in random walks
Our Method: Graph Likelihood Derivation
40
Graph Likelihood
Our Method: Graph Likelihood Derivation
41
Graph Likelihood
Our Method: Training
[7] Abu-El-Haija, Proportionate Gradient Updates with PercentDelta, 2017
42
where
Outline
43
Link Prediction Experiments
E
44
Link Prediction Experiments
E
Etrain+
Etest+
45
Link Prediction Experiments
E
Etrain+
Etrain-
Etest+
46
Link Prediction Experiments
E
Etrain+
Etrain-
Etest-
Etest+
|Etrain+| = |Etest+| = |Etrain-| = |Etest-|
47
Why Link Prediction?
48
Link Prediction Results
Sampled softmax
Graph Likelihood Objective
ca-AstroPh [5]
Protein-Protein Interaction [6]
49
dim | node2vec | Our Shallow | Our Deep Asym |
8 | 81.1 | 92.3 | 91.7 |
32 | 89.9 | 95.5 | 95.5 |
128 | 95.5 | 95.3 | 95.7 |
8 | 73.3 | 74.6 | 80.4 |
32 | 69.1 | 77.9 | 83.3 |
128 | 69.8 | 79.5 | 84.1 |
[5] http://snap.stanford.edu/data
[6] Stark et al. BioGRID: A General Repository for Interaction Datasets. Nucleic Acids Research 2006.
Link Prediction Results
Datasets from [5, 6]
50
[5] http://snap.stanford.edu/data
[6] Stark et al. BioGRID: A General Repository for Interaction Datasets. Nucleic Acids Research 2006.
Outline
51
Our Method: Visualization of Learned Embeddings
Embedding Protein-Protein Interaction graph dataset [6] using asymmetric projection of 2 dimensions.
Right Projection
Left Projection
52
Our Method: Visualization of Learned Embeddings
Right & Left Projections
53
Our Method: Visualization of Learned Embeddings
Pick node and show is edges
54
Outline
55
Our Method: Implementation
Code will be at: sami.haija.org/graph/deep_embedding.html
# Create train/test positive/negatives and simulate random walks:
$ python create_dataset_arrays.py --input ~/data/mygraph.txt \
--output ~/data/mygraph_arrays
# Train node embeddings and edge representation
$ python deep_edge_trainer.py --dataset_dir ~/data/mygraph_arrays
56
Outline
57
Conclusion
58
Thank you!
Any Questions?
59
Backup Slides
60
Link Prediction Results
Note: We ran node2vec using their default context window size (C=10).
Datasets from [5, 6]
61
[5] http://snap.stanford.edu/data
[6] Stark et al. BioGRID: A General Repository for Interaction Datasets. Nucleic Acids Research 2006.
Model Discussion: Can we skip f() ?
?
?
Skipping f() will hurt the generalization performance of the model, since:
Tables on next slide!
62
Model Discussion: Can we skip f() ?
Shallow = without f()
Deep = with f()
63
Visualization: soc-facebook [5] dataset (spherical constraints)
64
65
.v1
.v11
.v6
.v2
.v3
.v4
.v5
.v9
x
y
v1
v2
v3
v5
v4
v6
v11
v9