Word Embedding in PyTorch + Lightning @statquest
Word Embedding in PyTorch + Lightning  @statquest
Uploaded November 2023 | Updated September 2026, 1 week ago
Word embedding is the first step in lots of neural networks, including Transformers (like ChatGPT) and other state of the art models. Here we learn how to code a stand alone word embedding network from scratch and with nn.Linear. We then learn how to load and use pre-trained word embedding values with nn.Embedding.

NOTE: This StatQuest assumes that you are already familiar with Word Embedding, if not, check out the 'Quest: youtu.be/viZrOnJclY0

For a complete index of all the StatQuest videos, check out:
statquest.org/video-index

If you'd like to support StatQuest, please consider...

Patreon: patreon.com/statquest
...or...
YouTube Membership: youtube.com/channel/UCtYLUTtgS3k1Fg4y5tAhLbw/join

...buying one of my books, a study guide, a t-shirt or hoodie, or a song from the StatQuest store...
statquest.org/statquest-store

...or just donating to StatQuest!
paypal.me/statquest

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

0:00 Awesome song and introduction
1:53 Importing modules
2:48 Encoding the training data
6:55 Word Embedding from scratch
16:54 Graphing the embedding values
21:17 Printing out predicted words
20:37 Word Embedding with nn.Linear
28:12 Loading and using pre-trained Embedding values with nn.Embedding

#StatQuest #neuralnetworks #transformers
Word Embedding in PyTorch + LightningHuman Stories in AI: Xavier MoyáUsing Linear Models for t tests and ANOVA, Clearly Explained!!!Clustering with DBSCAN, Clearly Explained!!!Long Short-Term Memory with PyTorch + LightningStatistical Power, Clearly Explained!!!Christmas MorningWhat is AutoML? A conversation with Gnosis Data AnalysisGradient Boost Part 4 (of 4): Classification DetailsCalculating the Mean, Variance and Standard Deviation, Clearly Explained!!!Support Vector Machines Part 2: The Polynomial Kernel (Part 2 of 3)Luis Serrano + Josh Starmer Q&A Livestream!!!
StatQuest with Josh Starmer |

Word Embedding in PyTorch + Lightning

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER