liveBook · Manning

Weisfeiler-Lehman test

As explained in Build AI Drug Discovery Pipelines

The Weisfeiler–Lehman graph-isomorphism test is an iterative graph-labeling procedure used to compare graph structures by refining node labels from neighborhood labels.

The Weisfeiler–Lehman (WL) test is a classical graph-comparison procedure that iteratively refines node labels from neighborhood information. It provides a useful yardstick for graph neural network expressiveness: GIN can distinguish every pair of graphs that the WL test can distinguish. section 11.5.4

In graph neural networks for drug-target affinity prediction:

  • GIN uses sum aggregation, a learnable ε parameter for balancing a node's own features against neighbor features, and an MLP for nonlinear transformation. section 11.5.4
  • GIN is theoretically more expressive than GCN and GAT, although greater expressiveness can overfit limited training data. section 11.5.4
mol_nn1 = nn.Sequential(
    nn.Linear(num_features_mol, num_features_mol),
    nn.ReLU(),
    nn.Linear(num_features_mol, num_features_mol)
)
self.mol_conv1 = GINConv(mol_nn1)

A compact PyTorch Geometric pattern shows how an MLP is wrapped in GINConv to implement a WL-aligned graph layer. section 11.5.4

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Defines the WL test through its theoretical relation to GIN but does not detail label-refinement steps or proofs.
Examples
Uses GINConv code with sum aggregation, a learnable ε parameter, and an MLP as the practical example.
What you can do after
Evaluate/understand why GIN offers WL-level graph distinguishability and when added expressiveness may overfit.
How it connects
Connects Weisfeiler–Lehman expressiveness with GIN, GAT, GCN, graph neural networks, and drug-target affinity prediction.

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.