20.03.2021 Views

Deep-Learning-with-PyTorch

Create successful ePaper yourself

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

Using convolutions

to generalize

This chapter covers

• Understanding convolution

• Building a convolutional neural network

• Creating custom nn.Module subclasses

• The difference between the module and

functional APIs

• Design choices for neural networks

In the previous chapter, we built a simple neural network that could fit (or overfit)

the data, thanks to the many parameters available for optimization in the linear layers.

We had issues with our model, however, in that it was better at memorizing the

training set than it was at generalizing properties of birds and airplanes. Based on

our model architecture, we’ve got a guess as to why that’s the case. Due to the fully

connected setup needed to detect the various possible translations of the bird or

airplane in the image, we have both too many parameters (making it easier for the

model to memorize the training set) and no position independence (making it

harder to generalize). As we discussed in the last chapter, we could augment our

193

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

Saved successfully!

Ooh no, something went wrong!