Тёмный

Coding a ChatGPT Like Transformer From Scratch in PyTorch 

StatQuest with Josh Starmer
Подписаться 1,2 млн
Просмотров 13 тыс.
50% 1

In this StatQuest we walk through the code required to code your own ChatGPT like Transformer in PyTorch and we do it one step at a time, with every little detail clearly explained.
NOTE: This StatQuest assumes that you are already familiar with the concepts behind...
Decoder-Only Transformers: • Decoder-Only Transform...
The Essential Matrix Algebra for Neural Networks: • Essential Matrix Algeb...
The Matrix Math Behind Transformers: • The matrix math behind...
You can get the code here: github.com/StatQuest/decoder_...
The full Neural Networks playlist, from the basics to AI, is here: • The Essential Main Ide...
Learn more about GiveInternet.org: giveinternet.org/StatQuest NOTE: Donations up to $30 will be matched by an Angel Investor - so a $30 donation would give $60 to the organization. DOUBLE BAM!!!
If you'd like to support StatQuest, please consider...
Patreon: / statquest
...or...
RU-vid Membership: / @statquest
...buying my book, 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: www.paypal.me/statquest
venmo: @JoshStarmer
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
1:12 Loading the modules
2:04 Creating the training dataset
6:17 Coding Position Encoding
14:09 Coding Attention
21:04 Coding a Decoder-Only Transformer
26:39 Running the model (untrained)
29:18 Training and using the model
#StatQuest #PyTorch #chatgpt

Опубликовано:

 

2 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 70   
@statquest
@statquest 10 дней назад
- You can get the code here: github.com/StatQuest/decoder_transformer_from_scratch - Learn more about GiveInternet.org: giveinternet.org/StatQuest NOTE: Donations up to $30 will be matched by an Angel Investor - so a $30 donation would give $60 to the organization. DOUBLE BAM!!! - The full Neural Networks playlist, from the basics to AI, is here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CqOfi41LfDw.html - Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
@thebirdhasbeencharged
@thebirdhasbeencharged День назад
Can't imagine the work that goes into this, writing the code, making diagrams, recording, editing and voice over, you're the goat big J.
@statquest
@statquest День назад
Thanks!
@n.h.son1902
@n.h.son1902 День назад
You said this was going to come out at the end of May. And I’ve been waiting for this for 2 months. Finally, it’s out 😂
@statquest
@statquest День назад
I guess better later than never?
@TalkOfWang
@TalkOfWang День назад
It is party time! Thanks for uploading!
@statquest
@statquest День назад
You bet!
@bayoudata
@bayoudata День назад
Cool, learn a lot from all of your videos Josh! 🤯
@statquest
@statquest День назад
Thanks!
@muhammadikram375
@muhammadikram375 День назад
sir you deserved millions of views on your RU-vid ❤❤🎉
@statquest
@statquest День назад
Thanks!
@techproductowner
@techproductowner День назад
You will be rememberd for next 1000 years in the history of Statistics and Data Science , You should be named as "Father of Applied Statics & Machine Learning " , Pls thumbs up if you are with me
@statquest
@statquest День назад
BAM! :)
@jahanzebnaeem2525
@jahanzebnaeem2525 6 часов назад
HUGE RESPECT for all the work you put into your videos
@jawadmansoor6064
@jawadmansoor6064 День назад
Finally greatly watied video arrived. Thank you.
@statquest
@statquest День назад
Bam! :)
@ShadArfMohammed
@ShadArfMohammed День назад
as always, wonderful content. Thanks :)
@statquest
@statquest День назад
Thanks again!
@glaudiston
@glaudiston День назад
Today we learned that statquest is awesome. triple BAM!
@statquest
@statquest День назад
Thanks!
@205-cssaurabhmaulekhi9
@205-cssaurabhmaulekhi9 2 дня назад
Thank you I was in need of this 😊
@statquest
@statquest День назад
Glad it was helpful!
@neonipun
@neonipun День назад
I'm gonna enjoy this one!
@statquest
@statquest День назад
bam! :)
@gvascons
@gvascons День назад
Great and very didactic as usual, Josh!! Definitely going to wrap my head around this for a while and try a few tweaks! Do you plan on eventually also discussing other non-NLP topics like GANs and Diffusion Models?
@statquest
@statquest День назад
One day I hope to.
@sharjeel_mazhar
@sharjeel_mazhar День назад
Thank you! You're the best!!!
@statquest
@statquest День назад
You're welcome!
@jorgesanabria6484
@jorgesanabria6484 День назад
This will be awesome. I am trying to learn the math behind transformers and PyTorch so hopefully this helps give me some intuition
@statquest
@statquest День назад
I've got a video all about the math behind transformers here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KphmOJnLAdI.html
@mikinyaa
@mikinyaa 8 дней назад
🎉🎉🎉thank you😊
@statquest
@statquest 8 дней назад
bam! :)
@Mạnhfefe
@Mạnhfefe День назад
thank you sm fr bro
@statquest
@statquest 14 часов назад
Any time!
@gstiebler
@gstiebler 22 часа назад
Thanks!
@statquest
@statquest 14 часов назад
TRIPLE BAM!!! Thank you for supporting StatQuest!
@Faisal-cl9iu
@Faisal-cl9iu День назад
Thanks a lot for for this free wonderful content. ❤😊
@statquest
@statquest День назад
Thank you!
@zeroonetwothree1298
@zeroonetwothree1298 День назад
Legend.
@statquest
@statquest День назад
:)
@gustavojuantorena
@gustavojuantorena День назад
🎉🎉🎉
@statquest
@statquest День назад
Triple 🎉!
@TheFunofMusic
@TheFunofMusic День назад
Triple Bam!!!
@statquest
@statquest День назад
:)
@suika6459
@suika6459 День назад
amazinggg
@statquest
@statquest 14 часов назад
Thanks!
@nossonweissman
@nossonweissman День назад
BAM!!
@statquest
@statquest День назад
Thanks Nosson!
@zendr0
@zendr0 День назад
Bam!
@statquest
@statquest День назад
:)
@user-gh9fm2dn3t
@user-gh9fm2dn3t День назад
Baaaam!❤
@statquest
@statquest День назад
:)
@isaacsalzman
@isaacsalzman День назад
Ya misspelled ChatGPT - Generative Pre-trained Transformer
@statquest
@statquest День назад
Corrected! :)
@user-pj3td8sq6q
@user-pj3td8sq6q День назад
GTP :)
@statquest
@statquest День назад
Corrected! ;)
@acasualviewer5861
@acasualviewer5861 22 часа назад
I'm confused as to why the values would come from the ENCODER when computing the cross attention between the Encoder and Decoder. Shouldn't the values come from the decoder itself? So if I trained a model to translate from English to German, then wanted to switch out the German for Spanish, I'd expect the new decoder to know what to do with the output of the Encoder. But if the values are coming from the Encoder, then this wouldn't work.
@statquest
@statquest 14 часов назад
The idea is that the query in the decoder is used to determine how a potential word in the output is related to the words in the input. This done by using a query from the decoder and keys for all of the input words in the encoder. Then, once we have established how much (what percentages) a potential word in the output is related to all of the input word, we then have to determine what that percentage is of. It is of the values. And thus, the values have to come from the encoder. For more details, see: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zxQyTK8quyY.html
@keeperofthelight9681
@keeperofthelight9681 День назад
Sir can you include how to make the chatbot to hold a conversation with
@statquest
@statquest День назад
I'll keep that in mind.
@yosimadsu2189
@yosimadsu2189 День назад
🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻 Please please please show us how to train QVK Weights in detail 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻 You showed us just a simple call to function. But we are curious how it did the math, what to train, and how it can changes values of the weights. ABC
@statquest
@statquest 14 часов назад
Every single weight and bias in a neural network is trained with backpropagation. To learn more about how this process works, see: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IN2XmBhILt4.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iyn2zdALii8.html and ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-GKZoOHXGcLo.html
@yosimadsu2189
@yosimadsu2189 12 часов назад
@@statquest Since both QVK Weights are splitted and the calculations are passing non neural network, imho the back propagation process is quite tricky. In the other hand, the fit function did not tell the order of calculations on each nodes.
@ckq
@ckq День назад
GTP
@statquest
@statquest День назад
Corrected! :)
@mousquetaire86
@mousquetaire86 День назад
Wish you could be Prime Minister of the United Kingdom!
@statquest
@statquest День назад
Ha! :)
@naromsky
@naromsky День назад
From scratch in pytorch, huh.
@statquest
@statquest День назад
I decided to skip doing it in assembly. ;)
Далее
The Essential Main Ideas of Neural Networks
18:54
Просмотров 895 тыс.
1❤️
00:17
Просмотров 5 млн
Coding Stable Diffusion from scratch in PyTorch
5:03:32
ROC and AUC, Clearly Explained!
16:17
Просмотров 1,4 млн
Word Embedding and Word2Vec, Clearly Explained!!!
16:12
Entropy (for data science) Clearly Explained!!!
16:35
Просмотров 582 тыс.
The most important skill in statistics
13:35
Просмотров 308 тыс.
1❤️
00:17
Просмотров 5 млн