liveBook · Manning

Message passing

As explained in Build AI Drug Discovery Pipelines

A message passing algorithm iteratively aggregates information from neighboring nodes to update node representations in a graph.

Message passing is the core mechanism through which a graph neural network builds context-aware node representations. Each atom or protein residue starts with a feature vector, then repeatedly receives messages from neighboring nodes, aggregates them, and updates its own vector. section 11.4 section 11.8

A message-passing round follows three steps:

  • Form a message from each node connected by an edge. section 11.4
  • Aggregate messages with a permutation-invariant operation such as a sum or mean, so neighbor ordering does not affect the result. section 11.4
  • Update the node vector using the aggregate and its current value; stacking k rounds propagates information across k edges. section 11.4

Molecular and protein graphs

For drug-target affinity prediction, atoms and residues provide initial node features, while bonds or structural proximity provide edges. In PyTorch Geometric, node features occupy x, edges occupy edge_index with source and target rows, and optional edge features occupy edge_attr. These tensors support variable-sized graph batching. section 11.4 section 11.8

hi(k+1) = σ( W(k) AGG( { hj(k) : j ∈ N(i) ∪ {i} } ) )

Use the GCN update equation to connect neighbor aggregation, self-information, learned weights, and the activation function. section 11.4

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains the three-step update cycle, permutation invariance, graph tensors, and information range, while deferring full derivations.
Examples
Uses molecular atoms, protein residues, bonds, structural proximity, and PyTorch Geometric tensors as concrete teaching artifacts.
What it assumes
Assumes graph nodes, edges, and engineered features, while defining how neighborhood aggregation creates structural context.
What you can do after
Apply it via PyTorch Geometric to represent neighboring structure in molecular and protein graphs.
How it connects
Connects graph representations with GCN, GAT, GIN, node features, edge features, and PyTorch Geometric.

Also explained in

Compare how 13 books explain message passing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.