nn.Linear — the most important layer
nn.Linear(in_features, out_features) applies the affine transformation y = x W^T + b. The weight matrix is (out_features, in_features), the bias is (out_features,). This single layer is where 90% of the parameters in most models live (Transformer FFN blocks, classifier heads, embedding projections — all Linear).
Initialization defaults
By default, nn.Linear initializes the weight with Kaiming uniform (good for ReLU-family activations) and the bias with a uniform distribution scaled by the input fan-in. You usually don't override these — but knowing they exist is what makes "my model isn't training" debugging tractable.
The MLP idiom
A multi-layer perceptron is just Linear → activation → Linear → activation → ... → Linear. Modern variants add Dropout for regularization, LayerNorm for stability, and skip connections for very deep networks. The pattern is universal — every Transformer FFN block is a 2-layer MLP with a non-linearity (typically GELU) in the middle.