0PricingLogin
Deep Learning Academy · Lesson

Stacking Linear Layers

From input through hidden to output.

One Layer, One Transform

A single nn.Linear layer maps inputs to outputs with a weighted sum plus a bias. It reshapes data from one size to another.

layer = nn.Linear(in_features=4, out_features=8)

Input to Hidden

Your first layer takes the raw input features and projects them into a hidden space, often a larger or smaller width.

self.fc1 = nn.Linear(4, 16)   # 4 inputs -> 16 hidden

All lessons in this course

  1. Subclass nn.Module: __init__ and forward
  2. Stacking Linear Layers
  3. nn.Sequential for Quick Models
  4. Inspect Parameters and Layer Shapes
← Back to Deep Learning Academy