🖨️ Printing Instructions: Press Ctrl/Cmd + P and select "Save as PDF".
1

PyTorch In-Depth Tutorial

From Tensors to Training: Building Neural Networks with PyTorch

2

Part 1: Recap from Last Lecture

3

What We Learned

4

The Problem

5

Part 2: Why PyTorch?

6

PyTorch Overview

7

Why Not Other Frameworks?

8

Part 3: Tensors - The Building Block

9

What is a Tensor?

10

Creating Tensors

11

Tensor Operations

12

Tensor Attributes

13

Part 4: Autograd - Automatic Differentiation

14

The Magic of requires_grad

15

Autograd Example

16

Key Autograd Concepts

17

Part 5: Building Networks with torch.nn

18

The nn.Module Class

19

Simple Neural Network

20

Common Layers

21

Part 6: Loss Functions & Optimizers

22

Loss Functions

23

Optimizers

24

The Three Sacred Lines

25

Part 7: Dataset & DataLoader

26

Custom Dataset Class

27

Using Built-in Datasets

28

DataLoader

29

Part 8: The Full Training Loop

30

Training Recipe (Pseudocode)

31

Complete Training Loop

32

Part 9: Evaluation & Testing

33

Evaluation Mode

34

Evaluation Loop

35

Part 10: GPU Acceleration

36

Moving to GPU

37

GPU Best Practices

38

Part 11: Saving & Loading Models

39

Saving Models

40

Loading Models

41

Same Building Blocks

42

Key Takeaways