Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Implementing the Basic RNN | Introduction to RNNs
Introduction to RNNs

bookChallenge: Implementing the Basic RNN

Task

Swipe to start coding

  1. Define the SimpleRNN class, completing its __init__ method to set up the nn.RNN and nn.Linear layers, and implement its forward method to process input sequences.

  2. Instantiate the SimpleRNN model, then define the nn.CrossEntropyLoss criterion and torch.optim.Adam optimizer.

  3. Implement the training loop to perform forward and backward passes, update model parameters, and include a simple evaluation after training.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 4.55

bookChallenge: Implementing the Basic RNN

Swipe to show menu

Task

Swipe to start coding

  1. Define the SimpleRNN class, completing its __init__ method to set up the nn.RNN and nn.Linear layers, and implement its forward method to process input sequences.

  2. Instantiate the SimpleRNN model, then define the nn.CrossEntropyLoss criterion and torch.optim.Adam optimizer.

  3. Implement the training loop to perform forward and backward passes, update model parameters, and include a simple evaluation after training.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 4.55
SectionΒ 1. ChapterΒ 5
single

single

some-alt