Chapter 2: Deep learning

Graph neural networks: message passing and link prediction

You will be able to run one graph neural network (GNN) layer by hand and explain why deep GNNs blur nodes together. GNNs drive friend suggestions, drug-interaction checks and citation tools, and you will learn to judge them with ranking numbers. Interviews ask you to explain the layer, find the depth problem and design a link predictor without a leak.

16 minInteractive lessonChapter 2: Deep learningLesson 17 of 20

What you will learn

  • Run one message-passing step by hand on a small graph
  • Explain over-smoothing: why many layers make nodes look alike
  • Score candidate links with negative sampling and evaluate them with ranking metrics

Key terms

message-passing step
one round where every node collects values over its links and takes a new value
message
the value a node sends to a linked node
aggregate
the combination of collected values, such as a mean, that ignores their order
update
the new value a node takes from the aggregate

Prerequisites

Take Graphs as matrices: PageRank and spectral clustering first. It comes right before this lesson in the course.

Where this lesson picks up: You turned a graph into matrices and multiplied by one of them again and again, until the random walk settled into PageRank whatever its start. That left a question: can a neural network learn from a graph's links, and what happens when it multiplies by the graph many times?

What comes next

A GNN turns users into vectors and scores pairs of them. Next: can you sample new vectors and turn them into new data?

Next lesson: From autoencoders to VAEs: the ELBO and reparameterization

More lessons in this part

Take the lesson

Short cards, one idea at a time, with quick checks as you go.