Sectionย 1. Chapterย 5
single
Challenge: Implementing the Basic RNN
Swipe to show menu
Task
Swipe to start coding
-
Define the
SimpleRNNclass, completing its__init__method to set up thenn.RNNandnn.Linearlayers, and implement its forward method to process input sequences. -
Instantiate the
SimpleRNNmodel, then define thenn.CrossEntropyLosscriterion andtorch.optim.Adamoptimizer. -
Implement the training loop to perform forward and backward passes, update model parameters, and include a simple evaluation after training.
Solution
Everything was clear?
Thanks for your feedback!
Sectionย 1. Chapterย 5
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat