3.
5
The PyTorch API
Part 1: Model Training
Sebastian Raschka and the Lightning AI Team
De ne the Model
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
2
fi
The Logistic Regression Model
y
b
x1
× u = w1 × x1 + z=u+b a = σ(z) l = L(a, y)
w1
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
3
y
b
x1
× u = w1 × x1 + z=u+b a = σ(z) l = L(a, y)
w1
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
4
Train the Model (Part 1)
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
5
Train the Model (Part 1)
We will talk about
data loaders in more
details later!
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
6
Train the Model (Part 2)
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
7
Train the Model (Part 2)
If we omit this, gradients
will be accumulated,
which we usually don’t
want
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
8
Neural Network Layers
Sebastian Raschka Deep Learning Fundamentals, Unit 3 Lightning AI
9