Train PyTorch RNN to predict a sequence of integers, updated 2022
Channel: Hugh ML
Date: 2022-07-02

Build a neutral network from scratch in PyTorch.  We train an LSTM to memorize a sequence of integers. On the way, we pass through usage of embeddings, loss, optimizer, and argmax.

This is an updated version of the original video at https://youtu.be/MKA6v99uYKY 

The script written in the course of this video is available on github at https://github.com/hughperkins/pub-prototyping/blob/master/py/pytorch/predict_integers_rnn.py

00:00 - Intro
01:05 - Start coding
03:03 - Embedding
05:07 - RNN
05:52 - Python env
10:00 - batch_first
12:21 - LSTM outputs
14:00 - Seq2seq concept
15:00 - Decoder
21:00 - .max
25:39 - Training loop
27:13 - e2v Output linear layer
30:33 - Loss function
33:03 - Flatten cross entropy inputs
37:20 - Optimizer
39:36 - Gradients and backpropagation
41:54 - Run the script!
42:37 - Summary