Long Short-Term Memory with PyTorch + Lightning
StatQuest with Josh Starmer StatQuest with Josh Starmer
1.17M subscribers
55,355 views
0

 Published On Jan 24, 2023

In this StatQuest we'll learn how to code an LSTM unit from scratch and then train it. Then we'll do the same thing with the PyTorch function nn.LSMT(). Along the way we'll learn two cool tricks that Lightning gives us that make our lives easier: 1) How to add more training epochs without starting over and 2) How to easily visualize the training results to determine if you need to do more training or are done.

English
This video has been dubbed using an artificial voice via https://aloud.area120.google.com to increase accessibility. You can change the audio track language in the Settings menu.

Spanish
Este video ha sido doblado al español con voz artificial con https://aloud.area120.google.com para aumentar la accesibilidad. Puede cambiar el idioma de la pista de audio en el menú Configuración.

Portuguese
Este vídeo foi dublado para o português usando uma voz artificial via https://aloud.area120.google.com para melhorar sua acessibilidade. Você pode alterar o idioma do áudio no menu Configurações.


If you'd like to support StatQuest, please consider...
Patreon:   / statquest  
...or...
YouTube Membership:    / @statquest  

...buying my book, a study guide, a t-shirt or hoodie, or a song from the StatQuest store...
https://statquest.org/statquest-store/

...or just donating to StatQuest!
https://www.paypal.me/statquest

Lastly, if you want to keep up with me as I research and create new StatQuests, follow me on twitter:
  / joshuastarmer  

0:00 Awesome song and introduction
4:25 Importing the modules
5:39 An outline of an LSTM class
6:56 init(): Creating and initializing the tensors
9:09 lstm_unit(): Doing the LSTM math
12:25 forward(): Make a forward pass through an unrolled LSTM
13:42 configure_optimizers(): Configure the...optimizers.
14:00 training_step(): Calculate the loss and log progress
16:40 Using and training our homemade LSTM
20:43 Evaluating training with TensorBoard
23:22 Adding more epochs to training
26:18 Using and training PyTorch's nn.lstm()

#StatQuest

show more

Share/Embed