Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PyTorch Deep Learning Hands-On

You're reading from   PyTorch Deep Learning Hands-On Build CNNs, RNNs, GANs, reinforcement learning, and more, quickly and easily

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781788834131
Length 250 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Sherin Thomas Sherin Thomas
Author Profile Icon Sherin Thomas
Sherin Thomas
Sudhanshu Passi Sudhanshu Passi
Author Profile Icon Sudhanshu Passi
Sudhanshu Passi
Arrow right icon
View More author details
Toc

Approaches

We'll implement all the three methods: a basic RNN, an advanced RNN like LSTM or GRU, and a recursive network like SPINN, before looping through the SNLI dataset. Each data instance gives us a pair of sentences, a premise, and a hypothesis sentence. The sentences are converted to embeddings first and then passed into each implementation. While the process is the same for simple RNNs and advanced RNNs, SPINNs introduce a completely different flow for training and inference. Let's start with a simple RNN.

Simple RNN

RNNs have been used as the go-to NLP technique for understanding the meaning of data, and we can complete a numerous variety of tasks based on the sequential relations found from it. We will use this simple RNN to show how recurrence works effectively to accumulate the meaning and understand the meaning of words based on the context the words are in.

Before we start building any core modules of our network, we'll have to process the dataset and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image