liveBook · Manning

Graph convolutional network

As explained in Build AI Drug Discovery Pipelines

A graph convolutional network is a graph neural network that updates node representations by aggregating information from neighboring nodes with graph convolution operations.

A graph convolutional network (GCN) updates each node by combining its features with information from neighboring nodes. In a molecule, nodes can represent atoms and edges represent connectivity; shared weights let the same layer recognize patterns wherever they occur. Neighbor aggregation is permutation invariant, so changing node numbering does not change the result. section 11.4

A practical GCN workflow for drug-target affinity prediction is:

  • Store node features in x and graph connectivity in edge_index; use an additional edge-feature tensor when bonds or relationships carry features. section 11.4
  • Apply several GCN layers so node vectors incorporate progressively more distant neighborhood information. section 11.5.2
  • Use global mean pooling to turn variable-sized molecular or protein graphs into fixed-size vectors, then combine them for affinity prediction. section 11.5.2
  • Evaluate with cross-validation, validation MSE, checkpointing, and early stopping rather than treating a single training score as sufficient. section 11.5.6

Three-layer molecular branch

A molecular encoder can refine 78 atom features, expand them to 156 and then 312 features, pool across atoms, and compress the pooled vector through fully connected layers to a 128-dimensional embedding. Dropout follows the fully connected layers to reduce overfitting. section 11.5.2 section 11.5.6

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

The layer equation makes the update explicit: aggregate a node's neighbors and itself, apply a shared learned matrix, and pass the result through a nonlinearity. section 11.4

Listing 11.7 Process Molecular Graph through GCN Layers
def forward_mol(self, data_mol):
    mol_x, mol_edge_index, mol_batch = \
        data_mol.x, data_mol.edge_index, data_mol.batch
 
    x = self.relu(self.mol_conv1(mol_x, mol_edge_index))
    x = self.relu(self.mol_conv2(x, mol_edge_index))
    x = self.relu(self.mol_conv3(x, mol_edge_index))
 
    x = global_mean_pool(x, mol_batch)
 
    x = self.relu(self.mol_fc_g1(x))
    x = self.dropout(x)
    x = self.mol_fc_g2(x)
    x = self.dropout(x)
    return x

The implementation applies three graph convolutions, ReLU activations, batch-aware global mean pooling, and dense projection to produce a molecular embedding. section 11.5.2

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains tensor representation, layer updates, pooling, architecture dimensions, regularization, and evaluation, but defers detailed derivations.
Examples
Demonstrates three-layer molecular and protein branches, PyTorch Geometric pooling, and GCN, GAT, and GIN alternatives.
What it assumes
Defines node features, edge_index, batching, neighborhood aggregation, and graph pooling before using them in the architecture.
What you can do after
Builds a graph encoder that produces fixed-size molecule or protein embeddings for affinity prediction.
How it connects
Connects graph neural networks with message passing, global pooling, drug-target affinity prediction, GAT, and GIN.

Also explained in

Compare how 6 books explain graph convolutional network →

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.