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([[53, 53],

[75, 75]])

That’s 100% accuracy! Let’s try to visualize the effect of the GRU architecture on

the classification of the hidden states.

Visualizing the Model

Hidden States

Once again, if we use the "perfect" square as the input to our newly trained model,

we get the following final hidden states for each of the eight sequences (plotted

sided-by-side with the previous model for easier comparison):

Figure 8.20 - Final hidden states for eight sequences of the "perfect" square

The GRU model achieves a better separation of the sequences than its RNN

counterpart. What about the actual sequences?

Gated Recurrent Units (GRUs) | 637

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

Saved successfully!

Ooh no, something went wrong!