liveBook · Manning

Weight matrix

As explained in Build AI Drug Discovery Pipelines

A weight matrix is a rectangular array of model parameters whose entries associate input features with class-specific contributions.

A weight matrix is a rectangular collection of learnable parameters that transforms input features into model outputs. In multiclass prediction, each row represents one class and each column represents one feature, so every class receives its own feature weights. section 5.4.1 section 8.2.2

Use the matrix dimensions to understand how information moves through a model:

  • A matrix with shape (number of classes, number of features) supplies class-specific contributions for softmax regression. section 5.4.1
  • A fully connected layer with 2048 inputs and 512 outputs uses a weight matrix of shape (512, 2048), followed by a bias vector of length 512. section 8.2.2
  • Successive layers must align: the preceding layer's output count becomes the next layer's input count. section 8.2.2

A molecular-property neural network

A PyTorch kinase-binder model applies weight matrices through Linear layers: 2048 features become 512, then 256, then one prediction. ReLU activations and dropout operate between transformations, while training adjusts the matrices and bias vectors as learnable parameters. section 8.2.2

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains matrix roles, dimensions, affine transformations, and learnable parameters, but stops short of optimization internals.
Examples
Demonstrates class-by-feature matrices and a PyTorch kinase-binder network with 2048-to-512-to-256-to-1 dimensions.
What it assumes
Assumes feature vectors and basic classification vocabulary while defining matrix dimensions and affine transformations explicitly.
What you can do after
Evaluate how layer dimensions determine matrix shapes when reading or constructing a molecular-property neural network.
How it connects
Connects weight matrices to softmax regression, bias vectors, fully connected layers, activation functions, dropout, and cross-entropy loss.

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.