22.02.2024 Views

Daniel Voigt Godoy - Deep Learning with PyTorch Step-by-Step A Beginner’s Guide-leanpub

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7

Transfer Learning

Spoilers

In this chapter, we will:

• learn about ImageNet and popular models like AlexNet, VGG, Inception, and

ResNet

• use transfer learning to classify images from the Rock Paper Scissors dataset

• load pre-trained models for fine-tuning and feature extraction

• understand the role of auxiliary classifiers in very deep architectures

• use 1x1 convolutions as a dimension-reduction layer

• build an inception module

• understand how batch normalization impacts model training in many ways

• understand the purpose of residual (skip) connections and build a residual

block

Jupyter Notebook

The Jupyter notebook corresponding to Chapter 7 [105] is part of the official Deep

Learning with PyTorch Step-by-Step repository on GitHub. You can also run it

directly in Google Colab [106] .

If you’re using a local installation, open your terminal or Anaconda prompt and

navigate to the PyTorchStepByStep folder you cloned from GitHub. Then, activate

the pytorchbook environment and run jupyter notebook:

$ conda activate pytorchbook

(pytorchbook)$ jupyter notebook

If you’re using Jupyter’s default settings, this link should open Chapter 7’s

notebook. If not, just click on Chapter07.ipynb in your Jupyter’s home page.

498 | Chapter 7: Transfer Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!