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.

Output

tensor([[108, 124],

[116, 124],

[108, 124]])

It achieved an accuracy of 89.25% on the validation set. Not bad!

There is more to the Inception model than auxiliary classifiers, though. Let’s check

out some of its other architectural elements.

1x1 Convolutions

This particular architectural element is not exactly new, but it is a somewhat special

case of an already known element. So far, the smallest kernel used in a

convolutional layer had a size of three-by-three. These kernels performed an

element-wise multiplication, and then they added up the resulting elements to

produce a single value for each region to which they were applied. So far, nothing

new.

The idea of a kernel of size one-by-one is somewhat counterintuitive at first. For a

single channel, this kernel is only scaling the values of its input and nothing else.

That seems hardly useful.

But everything changes if you have multiple channels! Remember the threechannel

convolutions from Chapter 6? A filter has as many channels as its input.

This means that each channel will be scaled independently and the results will be

added up, resulting in one channel as output (per filter).

A 1x1 convolution can be used to reduce the number of

channels; that is, it may work as a dimension-reduction layer.

An image is worth a thousand words, so let’s visualize this.

524 | Chapter 7: Transfer Learning

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

Saved successfully!

Ooh no, something went wrong!