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 8

Sequences

Spoilers

In this chapter, we will:

• learn about the characteristics of sequential data and generate our own

• understand the inner workings of recurrent layers

• build and train models to perform classification of sequences

• understand the importance of the hidden state as the representation of a

sequence

• visualize the journey of a hidden state from beginning to end of a sequence

• pre-process variable-length sequences using padding and packing techniques,

as well as the collate function

• learn how 1D convolutions can be used on sequential data

Jupyter Notebook

The Jupyter notebook corresponding to Chapter 8 [134] is part of the official Deep

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

directly in Google Colab [135] .

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 8’s

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

Spoilers | 587

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

Saved successfully!

Ooh no, something went wrong!