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.

Figure 6.31 - Losses

Evaluation

print(StepByStep.loader_apply(

train_loader, sbs_cnn3.correct).sum(axis=0),

StepByStep.loader_apply(

val_loader, sbs_cnn3.correct).sum(axis=0))

Output

tensor([2511, 2520]) tensor([336, 372])

Looking good! Lower losses, 99.64% training accuracy, and 90.32% validation

accuracy.

Recap

In this chapter, we’ve introduced dropout layers for regularization and focused on

the inner workings of different optimizers and the role of the learning rate in the

process. This is what we’ve covered:

• computing channel statistics using a temporary data loader to build a

Normalize() transform

• using Normalize() to standardize an image dataset

• understanding how convolutions over multiple channels work

• building a fancier model with two typical convolutional blocks and dropout

layers

Recap | 495

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

Saved successfully!

Ooh no, something went wrong!