0% found this document useful (0 votes)
75 views

Graph Neural Network Introduction

Graph Neural Network Introduction

Uploaded by

mibmuw
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

Graph Neural Network Introduction

Graph Neural Network Introduction

Uploaded by

mibmuw
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

Note to other teachers and users of these slides: We would be delighted if you found our

material useful for giving your own lectures. Feel free to use these slides verbatim, or to modify
them to fit your own needs. If you make use of a significant portion of these slides in your own
lecture, please include this message, or a link to our web site: http://cs224w.Stanford.edu

CS224W: Machine Learning with Graphs


Jure Leskovec, Stanford University
http://cs224w.stanford.edu
Why Graphs?
Graphs are a general
language for describing and
analyzing entities with
relations/interactions

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 1


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 2
Graph
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 3
Image credit: SalientNetworks

Event Graphs Computer Networks Disease Pathways

Image credit: Wikipedia Image credit: visitlondon.com


Image credit: Pinterest

Food Webs Particle Networks Underground Networks


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 4
Image credit: Medium Image credit: Science Image credit: Lumen Learning

Social Networks Economic Networks Communication Networks

Image credit: Missoula Current News Image credit: The Conversation

Citation Networks Internet Networks of Neurons


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 5
Image credit: Maximilian Nickel et al Image credit: ese.wustl.edu Image credit: math.hws.edu

Knowledge Graphs Regulatory Networks Scene Graphs

Image credit: ResearchGate Image credit: MDPI Image credit: Wikipedia

Code Graphs Molecules 3D Shapes


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 6
Image credit: Maximilian Nickel et al
Main question: Image credit: ese.wustl.edu Image credit: math.hws.edu

Knowledge Graphs Regulatory Networks Scene Graphs


How do we take advantage of
relational structure for better
prediction?

Image credit: ResearchGate Image credit: MDPI Image credit: Wikipedia

Code Graphs Molecules 3D Shapes


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 7
Complex domains have a rich relational
structure, which can be represented as a
relational graph

By explicitly modeling relationships we


achieve better performance!

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 8


Images

Text/Speech

Modern deep learning toolbox is designed


for simple sequences & grids
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 9
Modern
deep learning toolbox
is designed for
sequences & grids

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 10


Not everything
can be represented as
a sequence or a grid
How can we develop neural
networks that are much more
broadly applicable?
New frontiers beyond classic neural
networks that only learn on images
and sequences
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 11
Graphs are the new frontier
of deep learning

Graphs connect things.

Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 12


2/16/2023
ICLR 2022 keywords

Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 13


2/16/2023
Networks are complex.
 Arbitrary size and complex topological
structure (i.e., no spatial locality like grids)

vs.
Text

Networks Images
 No fixed node ordering or reference point
 Often dynamic and have multimodal features
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 14
How can we develop neural networks
that are much more broadly
applicable?
Graphs are the new frontier
of deep learning
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 15

z

Predictions: Node labels,


New links, Generated
Input: Network graphs and subgraphs
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 16
Each node defines a computation graph
▪ Each edge in this graph is a
transformation/aggregation function
Scarselli et al. 2005. The Graph Neural Network Model. IEEE Transactions on Neural Networks.
Jure Leskovec, Stanford University 17
Neural networks

Intuition: Nodes aggregate information from their


neighbors using neural networks
Inductive Representation Learning on Large Graphs. W. Hamilton, R. Ying, J. Leskovec. NIPS, 2017.
Jure Leskovec, Stanford University 18
Intuition: Network neighborhood defines a
computation graph

Every node defines a computation


graph based on its neighborhood!

Jure Leskovec, Stanford University 19


(Supervised) Machine Learning Lifecycle:
This feature, that feature. Every single time!

Raw Graph Learning


Model
Data Data Algorithm

Feature Representation Downstream


Engineering prediction task
Learning --
Automatically
learn the features
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 20
Map nodes to d-dimensional
embeddings such that similar nodes in
the network are embedded close
together
nodeLearn a neural network representation
u
𝒇: 𝑢 → ℝ𝑑
ℝ𝑑
Feature representation,
embedding
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 21
We are going to explore Machine Learning and
Representation Learning for graph 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, Technology

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 22


Date Topic Date Topic
1. Introduction; Machine Learning 11. Community Structure
Tue, 1/10 Tue, 2/14
for Graphs in Networks
12. Traditional
Thu, 1/12 2. Node Embeddings Thu, 2/16
Generative Models for Graphs
3. Label Propagation for 13. Deep Generative Models
Tue, 1/17 Tue, 2/21
Node Classification for Graphs
4. Graph Neural Networks 1:
Thu, 1/19 Thu, 2/23 14. Advanced Topics on GNNs
GNN Model
5. Graph Neural Networks 2:
Tue, 1/24 Tue, 2/28 15. Scaling up GNNs
Design Space
6. Applications of Graph
Thu, 1/26 Thu, 3/2 16. Explainability
Neural Networks
Tue, 1/31 7. Theory of Graph Neural Networks Tue, 3/7 EXAM

Thu, 2/2 8. Knowledge Graph Embeddings Thu, 3/9 17. Guest lecture: TBD
9. Reasoning over
Tue, 2/7 Tue, 3/14 18. GNNs for Science
KnowledgeGraphs
10. Frequent Subgraph Mining with
Thu, 2/9 Thu, 3/16 19. Special topics in GNNs
GNNs

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 23


CS224W: Machine Learning with Graphs
Jure Leskovec, Stanford University
http://cs224w.stanford.edu
Node level

Graph-level
Community
prediction,
(subgraph)
Graph
level
generation

Edge-level

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 25


 Node classification: Predict a property of a node
▪ Example: Categorize online users / items
 Link prediction: Predict whether there are missing
links between two nodes
▪ Example: Knowledge graph completion
 Graph classification: Categorize different graphs
▪ Example: Molecule property prediction
 Clustering: Detect if nodes form a community
▪ Example: Social circle detection
 Other tasks:
▪ Graph generation: Drug discovery
▪ Graph evolution: Physical simulation
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 26
 Node classification: Predict a property of a node
▪ Example: Categorize online users / items
 Link prediction: Predict whether there are missing
links between two nodes
▪ Example: Knowledge graph completion
 GraphThese GraphCategorize
classification: ML tasks lead to
different graphs
▪ Example: Molecule property
high-impact prediction
applications!
 Clustering: Detect if nodes form a community
▪ Example: Social circle detection
 Others:
▪ Graph generation: Drug discovery
▪ Graph evolution: Physical simulation
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 27
A protein chain acquires its native 3D structure

Image credit: DeepMind

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 29


Computationally predict a protein’s 3D structure
based solely on its amino acid sequence

Image credit: DeepMind


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 30
Image credit: DeepMind
Image credit: SingularityHub

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 31


 Key idea: “Spatial graph”
▪ Nodes: Amino acids in a protein sequence
▪ Edges: Proximity between amino acids (residues)

Image credit: DeepMind

Spatial graph
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 32
 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

“You might also like”


Items
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 34
Ying et al., Graph Convolutional Neural Networks for Web-Scale Recommender Systems, KDD 2018

Task: Recommend related pins to users


Task: Learn node
embeddings 𝑧𝑖 such that
𝑑 𝑧𝑐𝑎𝑘𝑒1 , 𝑧𝑐𝑎𝑘𝑒2
< 𝑑(𝑧𝑐𝑎𝑘𝑒1, 𝑧𝑠𝑤𝑒𝑎𝑡𝑒𝑟 )
Query pin

Predict whether two nodes in a graph are related


𝑧

2/16/2023 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%
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs
prob. prob. 36
Zitnik et al., Modeling Polypharmacy Side Effects with Graph Convolutional Networks, Bioinformatics 2018

 Nodes: Drugs & Proteins Query: How likely


 Edges: Interactions will Simvastatin and
Ciprofloxacin, when
taken together,
break down muscle
tissue?

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 37


Zitnik et al., Modeling Polypharmacy Side Effects with Graph Convolutional Networks, Bioinformatics 2018

Drug c Drug d Evidence found

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 38


 a

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 40


 Nodes: Road segments
 Edges: Connectivity between road segments
 Prediction: Time of Arrival (ETA)

Image credit: DeepMind


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 41
Predicting Time of Arrival with Graph Neural
Networks

 Used in Google Maps

Image credit: DeepMind


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 42
 Antibiotics are small molecular graphs
▪ Nodes: Atoms
▪ Edges: Chemical bonds

Konaklieva, Monika I. "Molecular targets of β-lactam-based antimicrobials: Image credit: CNN


beyond the usual suspects." Antibiotics 3.2 (2014): 128-142.

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 44


Stokes et al., A Deep Learning Approach to Antibiotic Discovery, Cell 2020

 A Graph Neural Network graph classification model


 Predict promising molecules from a pool of candidates

Stokes, Jonathan M., et al. "A deep learning approach to antibiotic discovery."
Cell 180.4 (2020): 688-702.

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 45


You et al., Graph Convolutional Policy Network for Goal-Directed Molecular Graph Generation, NeurIPS 2018

Graph generation: Generating novel molecules

Use case 1: Generate novel molecules Use case 2: Optimize existing molecules to
with high Drug likeness value have desirable properties

Drug likeness
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 46
Sanchez-Gonzalez et al., Learning to simulate complex physics with graph networks, ICML 2020

Physical simulation as a graph:


 Nodes: Particles
 Edges: Interaction between particles

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 47


Sanchez-Gonzalez et al., Learning to simulate complex physics with graph networks, ICML 2020

A graph evolution task:


 Goal: Predict how a graph will evolve over
time

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 48


https://medium.com/syncedreview/deepmind-googles-ml-based-graphcast-outperforms-the-world-s-best-medium-range-weather-
9d114460aa0c
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 49
CS224W: Machine Learning with Graphs
Jure Leskovec, Stanford University
http://cs224w.stanford.edu
 Objects: nodes, vertices N
 Interactions: links, edges E
 System: network, graph G(N,E)

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 51


Movie 1
friend
Actor 1 Actor 2 co-worker
Peter Mary
Movie 3 Actor 4
Movie 2
friend
Tom
brothers

Actor 3 Albert

Protein 1 Protein 2
Protein 5

Protein 9 |N|=4
|E|=4
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 52
 If you connect individuals that work
with each other, you will explore a
professional network Image credit: Euro Scientists

 If you connect those that have a


sexual relationship, you will be
exploring sexual networks Image credit: ResearchGate

 If you connect scientific papers


that cite each other, you will be
studying the citation network
 If you connect all papers with the same word in the title,
what will you be exploring? It is a network, nevertheless
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 53
 How to build a graph:
▪ What are nodes?
▪ What are edges?
 Choice of the proper network representation
of a given domain/problem determines our
ability to use networks successfully:
▪ In some cases, there is a unique, unambiguous
representation
▪ In other cases, the representation is by no means
unique
▪ The way you assign links will determine the nature
of the question you can study
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 54
Undirected Directed
 Links: undirected  Links: directed
(symmetrical, reciprocal) (arcs)
L D
A B
M C
F
I
D
E
B G G
A
H
F
C

 Examples:  Examples:
▪ Collaborations ▪ Phone calls
▪ Friendship on Facebook ▪ Following on Twitter
2/16/2023 Jure Les kovec, Stanford CS224W: Ma chine Learning with Graphs 55
 A heterogeneous graph is defined as
𝑮 = 𝑽, 𝑬, 𝑹, 𝑻
▪ Nodes with node types 𝑣𝑖 ∈ 𝑉
▪ Edges with relation types 𝑣𝑖 , 𝑟, 𝑣𝑗 ∈ 𝐸
▪ Node type 𝑇 𝑣𝑖
▪ Relation type 𝑟 ∈ 𝑅

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 56
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

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 57
Node degree, ki: the number
Undirected

of edges adjacent to node i


A
kA = 4
1 N
Avg. degree: k = k = å ki = 2E
N i=1 N
In directed networks we define
D
B
an in-degree and out-degree.
Directed

C
The (total) degree of a node is the
G
E sum of in- and out-degrees.
kCin = 2 kCout = 1 kC = 3
A

E
Source: Node with kin = 0 k= k in = k out
Sink: Node with kout = 0 N
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 58
A
 Bipartite graph is a graph whose nodes can
be divided into two disjoint sets U and V such that
B
every link connects a node in U to one in V; that is,
U and V are independent sets
C

 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
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 59
4
4
3
3
2
2 1
1

Aij = 1 if there is a link from node i to node j


Aij = 0 otherwise

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.
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 60
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 61
Most real-world networks are sparse
E << Emax (or k << N-1)

Consequence: Adjacency matrix is filled with zeros!


(Density of the matrix (E/N2): WWW=1.51x10-5, MSN IM = 2.27x10-8)
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 62
Possible options:
▪ Weight (e.g., frequency of communication)
▪ Ranking (best friend, second best friend…)
▪ Type (friend, relative, co-worker)
▪ Sign: Friend vs. Foe, Trust vs. Distrust
▪ Properties depending on the structure of the rest
of the graph: Number of common friends

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 63


 Unweighted  Weighted
(undirected) (undirected)
4 4
1 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
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 64
 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

Aii  0 Aij = A ji Aii = 0 Aij = A ji


1 N N
1 N 2E
E=  Aij +  Aii  E =  nonzero( Aij ) k=
2 i , j =1,i  j i =1 2 i , j =1 N
Examples: Proteins, Hyperlinks Examples: Communication, Collaboration
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 65
 Connected (undirected) graph:
▪ Any two vertices can be joined by a path
 A disconnected graph is made up by two or
more connected components
B B
A A
Largest Component:
Giant Component

Isolated node (node H)


C C
D F F
D

H H
G G

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 66


The adjacency matrix of a network with several
components can be written in a block- diagonal
form, so that nonzero elements are confined to
squares, with all other elements being zero:
Disconnected
Connected

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 67


 Strongly connected directed graph
▪ has a path from each node to every other node
and vice versa (e.g., A-B path and B-A path)
 Weakly connected directed graph
▪ is connected if we disregard the edge directions
E
F
B

D C G Graph on the left is connected


but not strongly connected (e.g.,
there is no way to get from F to G by
following the edge directions).

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 68


 Strongly connected components (SCCs) can
be identified, but not every node is part of a
nontrivial strongly connected component.
SCC B
E
A F
B

D E C
D C G
F
G SCC
SCC

In-component: nodes that can reach the SCC,


Out-component: nodes that can be reached from the SCC.
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 69
 Machine learning with Graphs
▪ Applications and use cases

 Different types of tasks:


▪ Node level
▪ Edge level
▪ Graph level

 Choice of a graph representation:


▪ Directed, undirected, bipartite, weighted,
adjacency matrix
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 70
CS224W: Machine Learning with Graphs
Jure Leskovec, Stanford University
http://cs224w.stanford.edu
 The course is self-contained.
 No single topic is too hard by itself.
 But we will cover and touch upon many topics
and this is what makes the course hard.
▪ Good background in:
▪ Machine Learning
▪ Algorithms and graph theory
▪ Probability and statistics
▪ Programming:
▪ You should be able to write non-trivial programs (in Python)
▪ Familiarity with PyTorch is a plus
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 72
 We use PyG (PyTorch Geometric):
▪ The ultimate library for Graph Neural Networks
 We further recommend:
▪ GraphGym: Platform for designing Graph Neural
Networks.
▪ Modularized GNN implementation, simple hyperparameter
tuning, flexible user customization
▪ Both platforms are very helpful for the course project
(save your time & provide advanced GNN
functionalities)
 Other network analytics tools: SNAP.PY, NetworkX
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 73
 The class meets Tue and Thu 3:00-4:20pm
Pacific Time in person
▪ Videos of the lectures will be recorded and posted
on Canvas
 Structure of lectures:
▪ 70-80 minutes of a lecture
▪ During this time you can ask questions
▪ 10 minutes of a live Q&A/discussion session at the
end of the lecture

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 74


2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 75
 http://cs224w.stanford.edu
▪ Slides posted before the class
 Readings:
▪ Graph Representation Learning Book by
Will Hamilton
▪ Research papers
 Optional readings:
▪ Papers and pointers to additional literature
▪ This will be very useful for course projects

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 76


 Ed Discussion:
▪ Access via link on Canvas
▪ Please participate and help each other!
▪ Don’t post code, annotate your questions, search for
answers before you ask
▪ We will post course announcements to Ed (make
sure you check it regularly)
 Please don’t communicate with prof/TAs via
personal emails, but always use:
[email protected]

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 77


 OHs will be virtual
▪ We will have OHs every day, starting from 2nd week
of the course
▪ See http://web.stanford.edu/class/cs224w/oh.html
for Zoom links and link to QueueStatus
▪ Schedule to be announced by end of week

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 78


 Final grade will be composed of:
▪ Homework: 25%
▪ 3 written homeworks, each worth 8.3%
▪ Coding assignments: 20%
▪ 5 coding assignments using Google Colab, each worth 4%
▪ Exam: 35%
▪ Course project: 20%
▪ Proposal: 20%; Final report: 70%; Poster: 10%
▪ Extra credit: Ed participation, PyG/GraphGym code
contribution
▪ Used if you are on the boundary between grades
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 79
 How to submit?
▪ Upload via Gradescope
▪ You will be automatically registered to Gradescope once
you officially enroll in CS224W
▪ Homeworks, Colabs (numerical answers), and
project deliverables are submitted on Gradescope
 Total of 2 Late Periods (LP) per student
▪ Max 1 LP per assignment (no LP for the final report)
▪ LP gives 4 extra days: assignments usually due on
Thursday (11:59pm) → with LP, it is due the following
Monday (11:59pm)

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 80


 Homeworks (25%, n=3)
▪ Written assignments take longer and take time
(~10-20h) – start early!
▪ A combination of theory, algorithm design, and math
 Colabs (20%, n=5)
▪ We have more Colabs but they are shorter
(~3-5h); Colab 0 is not graded.
▪ Get hands-on experience coding and training GNNs;
good preparation for final projects and industry

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 81


 Single exam: Thursday, March 7 (no class)
▪ Take-home, open-book, timed
▪ Administered via Gradescope
▪ Released at 10am PT on Thursday March 7, available
until 10am PT the following day
▪ Once you open it, you will have 100 minutes to
complete the exam
▪ Content
▪ Will have written questions (similar to Homework), will
possibly have a coding section (similar to Colabs)
▪ More details to come!

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 82


 Details will be posted soon:
▪ Focus is on real-world applications of GNNs
 Logistics
▪ Groups of up to 3 students
▪ Groups of 1 or 2 are allowed; the team size will be
taken under consideration when evaluating the scope
of the project. But 3 person teams can be more
efficient.
▪ Google Cloud credits
▪ We will provide $50 in Google Cloud credits to each student
▪ You can also get $300 with Google Free Trial
(https://cloud.google.com/free/docs/gcp-free-tier)
 Read: http://cs224w.stanford.edu/info.html

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 83


Assignment Due on (11:59pm PT)

Colab 0 Not graded


Colab 1 Thu, 1/26 (week 3)
Homework 1 Thu, 2/2 (week 4)
Project Proposal Tue, 2/7 (week 5)
Colab 2 Thu, 2/9 (week 5)
Homework 2 Thu, 2/16 (week 6)
Colab 3 Tue, 2/23 (week 7)
Homework 3 Thu, 3/2 (week 8)
EXAM Thu, 3/7 (week 9)
Colab 4 Thu, 3/9 (week 9)
Colab 5 Thu, 3/14 (week 10)
Project Report Thu, 3/21 (No Late Periods!)
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 84
Make sure you read
and understand it!

 We strictly enforce the Stanford Honor Code


▪ Violations of the Honor Code include:
▪ Copying or allowing another to copy from one’s own paper
▪ Unpermitted collaboration
▪ Plagiarism
▪ Giving or receiving unpermitted aid on a take-home examination
▪ Representing as one’s own work the work of another
▪ Giving or receiving aid on an assignment under circumstances in
which a reasonable person should have known that such aid was
not permitted
▪ The standard sanction for a first offense includes a one-
quarter suspension and 40 hours of community service.
2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs 85
Two ways to ask questions during lecture:
 In-person (encouraged)
 On Ed:
▪ At the beginning of class, we will open a new
discussion thread dedicated to this lecture
▪ When to ask on Ed?
▪ If you are watching the livestream remotely
▪ If you have a minor clarifying question
▪ If we run out of time to get to your question live
▪ Otherwise, try raising your hand first!

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 86
 Colabs 0 and 1 will be released on our course
website at 3pm Thursday (1/12)
 Colab 0:
▪ Does not need to be handed-in
 Colab 1:
▪ Due on Thursday 10/07 (2 weeks from today)
▪ Submit written answers and code on Gradescope
▪ Will cover material from Lectures 1-4, but you
can get started right away!

2/16/2023 Jure Leskovec, Stanford CS224W: Machine Learning with Graphs, http://cs224w.stanford.edu 87

You might also like