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
