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.

Output

(tensor([[-0.5873, -2.5140],

[-1.6189, -0.4233]], device='cuda:0'),

tensor([0.8272, 0.9219], device='cuda:0'))

"What does it look like?"

Let’s visualize the transformed "perfect" square.

Figure 8.13 - Transformed inputs (corners)

Our SquareModel learned that it needs to scale, shear, flip, and translate the inputs

(corners) at every step before adding each of them to the transformed hidden

state.

Hidden States

Remember, there are eight possible sequences (Figure 8.3) since it is possible to

start at any of the four corners, and move in either direction. Each corner was

assigned a color (as in the figure above), and since clockwise is the positive class, it

is represented by a "+" sign.

If we use the "perfect" square as input to our trained model, that’s what the final

hidden states look like for each of the eight sequences.

620 | Chapter 8: Sequences

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

Saved successfully!

Ooh no, something went wrong!