22.02.2024 Views

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Affine Transformations

An affine transformation is simply a linear transformation (w T x), such as

rotating, scaling, flipping, or shearing, followed by a translation (b).

If you want to learn more about it, and really understand the role of matrices

in linear transformations, including beautiful visualizations, make sure to

check 3Blue1Brown's channel on YouTube, especially the "Essence of linear

algebra" [80] series. It is amazing! Seriously, don’t miss it!

If you have time to watch the entire series, great, but if you need to keep it to

a minimum, stick with these three:

• Linear transformations and matrices—Chapter 3 [81]

• Matrix multiplication as composition—Chapter 4 [82]

• Nonsquare matrices as transformations between dimensions—Chapter 8

[83]

A Two-Dimensional Model

To visualize these effects, we’ll have to keep everything in a two-dimensional

feature space. Our model looks like the figure below.

Figure B.2 - Model diagram

It has one hidden layer with an activation function (and here we can try any of our

choosing), and an output layer followed by a sigmoid function, typical of a binary

classification. The model above corresponds to the following code:

A Two-Dimensional Model | 333

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

Saved successfully!

Ooh no, something went wrong!