Web - Stanford.edu 01-Intro
Web - Stanford.edu 01-Intro
Thu, Oct 21 10. Knowledge Graph Embeddings Thu, Dec 2 19. GNNs for Science
Tracey Xuan
7:00pm- 1:00pm-
9:00pm 3:00pm
Text/Speech
vs.
Text
Networks Images
No fixed node ordering or reference point
Often dynamic and have multimodal features
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 33
How can we develop neural networks
that are much more broadly
applicable?
Graphs are the new frontier
of deep learning
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 34
…
z
Feature representation,
embedding
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 37
We are going to cover various topics in Machine
Learning and Representation Learning for graph
structured data:
▪ Traditional methods: Graphlets, Graph Kernels
▪ Methods for node embeddings: DeepWalk, Node2Vec
▪ Graph Neural Networks: GCN, GraphSAGE, GAT,
Theory of GNNs
▪ Knowledge graphs and reasoning: TransE, BetaE
▪ Deep generative models for graphs: GraphRNN
▪ Applications to Biomedicine, Science, Industry
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 38
Date Topic Date Topic
1. Introduction; Machine Learning 11. Reasoning over Knowledge
Tue, Sep 21 Tue, Oct 26
for Graphs Graphs
2. Traditional Methods for ML on 12. Frequent Subgraph Mining
Thu, Sep 23 Thu, Oct 28
Graphs with GNNs
13. Community Structure in
Tue, Sep 28 3. Node Embeddings Thu, Nov 4
Networks
14. Traditional Generative
Thu, Sep 30 4. Link Analysis: PageRank Tue, Nov 9
Models for Graphs
5. Label Propagation for Node 15. Deep Generative Models for
Tue, Oct 5 Thu, Nov 11
Classification Graphs
6. Graph Neural Networks 1: GNN
Thu, Oct 7 Tue, Nov 16 16. Advanced Topics on GNNs
Model
7. Graph Neural Networks 2: Design
Tue, Oct 12 Thu, Nov 18 17. Scaling Up GNNs
Space
8. Applications of Graph Neural
Thu, Oct 14 Fri, Nov 19 EXAM
Networks
Tue, Oct 19 9. Theory of Graph Neural Networks Tue, Nov 30 18. Guest lecture: TBD
Thu, Oct 21 10. Knowledge Graph Embeddings Thu, Dec 2 19. GNNs for Science
Graph-level
Community
prediction,
(subgraph)
Graph
level
generation
Edge-level
Spatial graph
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 48
Users interacts with items
▪ Watch movies, buy merchandise, listen to music
▪ Nodes: Users and items
▪ Edges: User-item interactions
Goal: Recommend items users might like
Users
Interactions
Query pin
9/22/2021 Jure Les kovec, Stanford CS224W: Ma chine Learning with Graphs 8
Prescribed
Many patients take multiple drugsDrug
to treat
drugs side effect
complex or co-existing diseases:
46% of people ages 70-79 take more than 5 drugs
Many patients take more than 20 drugs to treat
heart disease, depression, insomnia, etc.
Task: Given a pair of drugs predict
adverse side effects
30%
, 65%
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs
prob. prob. 52
Zitnik et al., Modeling Polypharmacy Side Effects with Graph Convolutional Networks, Bioinformatics 2018
Stokes, Jonathan M., et al. "A deep learning approach to antibiotic discovery."
Cell 180.4 (2020): 688-702.
Use case 1: Generate novel molecules Use case 2: Optimize existing molecules to
with high Drug likeness value have desirable properties
Drug likeness
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 62
Sanchez-Gonzalez et al., Learning to simulate complex physics with graph networks, ICML 2020
Actor 3 Albert
Protein 1 Protein 2
Protein 5
Protein 9 |N|=4
|E|=4
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 67
If you connect individuals that work
with each other, you will explore a
professional network Image credit: Euro Scientists
Examples: Examples:
▪ Collaborations ▪ Phone calls
▪ Friendship on Facebook ▪ Following on Twitter
9/22/2021 Jure Les kovec, Stanford CS224W: Ma chine Learning with Graphs 70
A heterogeneous graph is defined as
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 71
Biomedical Knowledge Graphs Academic Graphs
Example node: Migraine Example node: ICML
Example edge: (fulvestrant, Treats, Breast Neoplasms) Example edge: (GraphSAGE, NeurIPS)
Example node type: Protein Example node type: Author
Example edge type (relation): Causes Example edge type (relation): pubYear
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 72
Node degree, ki: the number
Undirected
C
The (total) degree of a node is the
G
E sum of in- and out-degrees.
kCin = 2 kCout = 1 kC = 3
A
Examples: D
▪ Authors-to-Papers (they authored)
E
▪ Actors-to-Movies (they appeared in)
U V
▪ Users-to-Movies (they rated)
▪ Recipes-to-Ingredients (they contain)
“Folded” networks:
▪ Author collaboration networks
▪ Movie co-rating networks
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 74
Projection U U V Projection V
0 1 0 1 0 0 0 1
1 0 0 1 1 0 0 0
A= A=
0 0 0 1 0 0 0 0
1 0 0 0
1 1 1 1
Note that for a directed graph (right) the matrix is not symmetric.
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 76
æ0 1 0 1ö N
4 ç ÷ ki = åA ij
ç 1 0 0 1÷ j =1
Undirected
Aij =
3 ç0 0 0 1÷ N
ç ÷ k j = å Aij
2 è1 1 1 0ø i=1
1
Aij = A ji N N
L = å ki = å Aij
1 1
Aii = 0 2 i=1 2 ij
0 0 0 1
out
4 1 0 0 0
Directed
A=
0 0 0 0 N
3
0
k out
in
= å Aij
0
j
2 1 1 i=1
1 N N N
L = åk in
= åk out
= å Aij
Aij ¹ A ji i=1
i
j=1
j
i, j
Aii = 0
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 77
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 78
Most real-world networks are sparse
E << Emax (or k << N-1)
▪ (3, 4)
▪ (4, 5) 5 4
▪ (5, 2)
▪ (5, 1)
2 2
3 3
0 1 1 0 0 2 0.5 0
1 0 1 1 2 0 1 4
Aij = Aij =
1 1 0 0 0.5 1 0 0
0 1 0 0 0 4 0 0
Aii = 0 Aij = A ji Aii = 0 Aij = A ji
1 N 1 N 2E
E = å Aij k=
2E
E = nonzero( Aij ) k=
2 i, j=1 N 2 i , j =1 N
Examples: Friendship, Hyperlink Examples: Collaboration, Internet, Roads
9/22/2021 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 83
Self-edges (self-loops) Multigraph
(undirected) (undirected)
4 4
1 1
2 2
3 3
1 1 1 0 0 2 1 0
1 0 1 1 2 0 1 3
Aij = Aij =
1 1 0 0 1 1 0 0
0 1 0 1 0 3 0 0
H H
G G
D E C
D C G
F
G SCC
SCC