To learn more about Lightning: lightning.ai/ Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
@tosinadekunle6462 ай бұрын
@statquest No problem Sir. Thank you.
@koofumkim4571 Жыл бұрын
“Statquest is all you need” - I really needed this video for my NLP course but glad it’s out now. I got an A+ for the course, your precious videos helped a lot!
@statquest Жыл бұрын
BAM! :)
@atharva1509 Жыл бұрын
Somehow Josh always figures out what video are we going to need!
@yashgb Жыл бұрын
Exactly, I was gonna say the same 😃
@statquest Жыл бұрын
BAM! :)
@yesmanic Жыл бұрын
Same here 😂
@MelUgaddan Жыл бұрын
The level of explainability from this video is top-notch. I always watch your video first to grasp the concept then do the implementation on my own. Thank you so much for this work !
@statquest Жыл бұрын
Glad it was helpful!
@XDogEntertainment Жыл бұрын
This channel is pure gold. I'm a machine learning and deep learning student.
@statquest Жыл бұрын
Thanks!
@sameepshah38355 ай бұрын
The amount of effort for some of these animations, especially in these videos on Attention and Transformers in insane. Thank you!
@statquest5 ай бұрын
Glad you like them!
@OsamaAlatraqchi4 ай бұрын
This is the best explanation ever, not only in this video, but the entire course...... Thanks a lot...
@statquest4 ай бұрын
Glad you are enjoying the whole course.
@lunamita9 ай бұрын
Can’t thank enough for this guy helped me get my master degree in AI back in 2022, now I’m working as a data scientist and still kept going back to your videos.
@statquest9 ай бұрын
BAM!
@rutvikjere6392 Жыл бұрын
I was literally trying to understand attention a couple of days ago and Mr.BAM posts a video about it. Thanks 😊
@NoahElRhandour Жыл бұрын
same :D abesolutely insane...
@statquest Жыл бұрын
BAM! :)
@Murattheoz Жыл бұрын
I feel like I am watching a cartoon as a kid. :)
@statquest Жыл бұрын
bam!
@Namenlos-r8f3 ай бұрын
bu mecrada ilk defa türk görüyorum, bilg müh ögrencisi misin?
@Cld136 Жыл бұрын
Thanks for the wholesome contents! Looking for Statquest video on the Transformer.
@statquest Жыл бұрын
Wow!!! Thank you so much for supporting StatQuest!!! I'm hoping the StatQuest on Transformers will be out by the end of the month.
@Cld136 Жыл бұрын
❤
@nikolamarkovic9906 Жыл бұрын
for this video attention is all you need
@statquest Жыл бұрын
Ha!
@sinamon629611 ай бұрын
Hi mr josh, just wanna say that there is literally no one that makes it so easy for me to understand such complicated concepts. Thank you ! once I get a job I will make sure to give you guru dakshina! (meaning, an offering from students to their teachers)
@statquest11 ай бұрын
Thank you very much! I'm glad my videos are helpful! :)
@usser-505 Жыл бұрын
The end is a classic cliffhanger for the series. You talk about how we don't need the LSTMs and I wait for an entire summer for transformers. Good job! :)
@statquest Жыл бұрын
Ha! The good news is that you don't have to wait! You can binge! Here's the link to the transformers video: kzbin.info/www/bejne/sKm0qoeBbdaor7s
@usser-505 Жыл бұрын
@@statquestYeah! I already watched when you released it. I commented on how this deep learning playlist is becoming a series! :)
@statquest Жыл бұрын
@@usser-505 bam!
@dylancam812 Жыл бұрын
Dang this came out just 2 days after my neural networks final. I’m still so happy to see this video in feed. You do such great work Josh! Please keep it up for all the computer scientists and statisticians that love your videos and eagerly await each new post
@statquest Жыл бұрын
Thank you very much! :)
@Neiltxu Жыл бұрын
@@statquest it came out 3 days before my Deep Learning and NNs final. BAM!!!
@statquest Жыл бұрын
@@Neiltxu Awesome! I hope it helped!
@Neiltxu Жыл бұрын
@@statquest for sure! Your videos always help! btw, do you ship to spain? I like the hoodies of your shop
@statquest Жыл бұрын
@@Neiltxu I believe the hoodies ship to Spain. Thank you for supporting StatQuest! :)
@Travel-Invest-Repeat Жыл бұрын
Great work, Josh! Listening to my deep learning lectures and reading papers become way easier after watching your videoes, because you explain the big picture and the context so well!! Eagerly waiting for the transformers video!
@statquest Жыл бұрын
Coming soon! :)
@aquater1120 Жыл бұрын
I was just reading the original attention paper and then BAM! You uploaded the video. Thank you for creating the best content on AI on KZbin!
@statquest Жыл бұрын
Thank you very much! :)
@clockent Жыл бұрын
This is awesome mate, can't wait for the next installment! Your tutorials are indispensable!
@statquest Жыл бұрын
Thank you!
@rajapandey20397 ай бұрын
@@statquest BAM!
@aayush1204 Жыл бұрын
1 million subscribers INCOMING!!! Also huge thanks to Josh for providing such insightful videos. These videos really make everything easy to understand, I was trying to understand Attention and BAM!! found this gem.
@statquest Жыл бұрын
Thank you very much!!! BAM! :)
@ArpitAnand-yd7tr Жыл бұрын
The best explanation of Attention that I have come across so far ... Thanks a bunch❤
@statquest Жыл бұрын
Thank you very much! :)
@jacobverrey4075 Жыл бұрын
Josh - I've read the original papers and countless online explanations, and this stuff never makes sense to me. You are the one and only reason as to why I understand machine learning. I wouldn't be able to make any progress on my PhD if it wasn't for your videos.
@statquest Жыл бұрын
Thanks! I'm glad my videos are helpful! :)
@brunocotrim24156 ай бұрын
Hello Statquest, I would like to say Thank You for the amazing job, this content helped me understand a lot how Attention works, specially because visual things help me understand better, and the way you join the visual explanation with the verbal one while keeping it interesting is on another level, Amazing work
@statquest6 ай бұрын
Thank you!
@naomilago Жыл бұрын
The music sang before the video are contagious ❤
@statquest Жыл бұрын
:)
@machinelearninggoddess12 күн бұрын
3:14 That and the vanishing gradient problem is a key factor. NNs update themselves with gradient descent, basically derivatives, and the deeper the LSTM, the more we are applying the derivative of a derivative of a derivative so on so forth of a gradient value, and since the original loss value gradient is reduced astronomically every time a derivative, beyond a dozen or so LSTM cells the gradient might become 0 and this results in the earlier LSTMs literally not learning. So not only do LSTMs not remember stuff from previous words long away, they can't learn stuff on how to deal with previous words long away either, a double whammy :(
@statquest12 күн бұрын
bam! :)
@machinelearninggoddess12 күн бұрын
@@statquest It's a double bam but it is directed at our faces and our NN, not at the problem we are trying to solve, which is really bad :(
@benmelis41177 ай бұрын
I just wanna let you know that this series is absolutely amazing. So far, as you can see, I've made it to the 89th video, guess that's something. Now it's getting serious tho. Again, love what you're doing here man!!! Thanks!!
@statquest7 ай бұрын
Thank you so much!
@benmelis41177 ай бұрын
@@statquest Personally, since I'm a medical student, I really can't explain how valuable it is to me that you used so many medical examples in the video's. The moment you said in one of the first video's that you are a geneticist I was sold to this series, it's one of my favorite subjects at uni, crazy interesting!
@statquest7 ай бұрын
@@benmelis4117 BAM! :)
@gordongoodwin6279 Жыл бұрын
fun fact - if your vectors are scaled/mean-centered, cosine similarity is geometrically equivalent to the pearson correlation, and the dotproduct is the same as the covariance (un-scaled correlation).
@statquest Жыл бұрын
nice.
@mehmeterenbulut6076 Жыл бұрын
I was stunned when you start the video with a catch jingle man, cheers :D
@statquest Жыл бұрын
:)
@jarsal_firahel Жыл бұрын
Before, I was dumb, "guitar" But now, people say I'm smart "guitar" What is changed ? "guitar" Now I watch..... StatQueeeeeest ! "guitar guitar"
@statquest Жыл бұрын
bam!
@x7A9cF2k4 ай бұрын
Josh! Again to geg some attention with a cup of coffee, Double BAM!!
@statquest4 ай бұрын
Thanks!
@ArpitAnand-yd7tr Жыл бұрын
Really looking forward to your explanation of Transformers!!!
@statquest Жыл бұрын
Thanks!
@rafaeljuniorize8 ай бұрын
this was the most beautiful explanation that i ever had in my entire life, thank you!
@statquest8 ай бұрын
Wow, thank you!
@won20529jun Жыл бұрын
I was literally just thinking an Id love an explanation of attention by SQ..!!! Thanks for all your work
@statquest Жыл бұрын
bam!
@AntiPolarity Жыл бұрын
can't wait for the video about Transformers!
@statquest Жыл бұрын
Me too!
@sourabhverma90344 ай бұрын
This is called Luong attention. In its previous version, a simple neural net was used to get similarity scores instead of dot product which was trained along with rest of RNN, this older version was called bahdanau attention. Thank you for the amazing video, I had to watch it twice to make sense of it but it is amazingly done. If I can make a request/suggestion, showing mathematical equations sometimes helps making sense of things. So if you can include them in future videos, that would be great.
@statquest4 ай бұрын
I'll keep that in mind.
@ncjanardhan7 ай бұрын
The BEST explanation of Attention models!! Kudos & Thanks 😊
@statquest7 ай бұрын
Thank you very much!
@saschahomeier3973 Жыл бұрын
You have a talent for explaining these things in a straightforward way. Love your videos. You have no video about Transformers yet, right?
@statquest Жыл бұрын
The transformers video is currently available to channel members and patreon supporters.
@rrrprogram8667 Жыл бұрын
Excellent josh.... So finally MEGA Bammm is approaching..... Hope u r doing good...
@statquest Жыл бұрын
Yes! Thank you! I hope you are doing well too! :)
@frogloki882 Жыл бұрын
Another BAM!
@statquest Жыл бұрын
Thanks!
@chessplayer0106 Жыл бұрын
Ah excellent this is exactly what I was looking for!
@statquest Жыл бұрын
Thank you!
@birdropping Жыл бұрын
@@statquest Can't wait for the next episode on Transformers!
@Ghost-ip3bx5 ай бұрын
Hi StatQuest, I've been a long time fan, your videos have helped me TREMENDOUSLY. For this video I felt however if we could get a larger picture of how attention works first ( how different words can have different weights ( attending to them differently )) and then going through a run with actual values, it'd be great! :) I also felt that the arrows and diagrams got a bit confusing in this one. Again, this is only constructive criticism and maybe it works for others and just not for me ( this video I mean ). Nonetheless, thank you so much for all the time and effort you put into making your videos. You're helping millions of people out there clear their degrees and achieve life goals
@statquest5 ай бұрын
Thanks for the feedback! I'm always trying to improve how I make videos. Anyway, I work through the concepts more in my videos on transformers: kzbin.info/www/bejne/sKm0qoeBbdaor7s and if the diagrams are hard to follow, I also show how it works using matrix math: kzbin.info/www/bejne/gaHLnoKAo7F0mqs
@CatatanSiRebiaz Жыл бұрын
Currently learning about artificial neural networks😁
@statquest Жыл бұрын
bam! :)
@thanhtrungnguyen8387 Жыл бұрын
can't wait for the next StatQuest
@statquest Жыл бұрын
:)
@thanhtrungnguyen8387 Жыл бұрын
@@statquest I'm currently trying to fine-tune Roberta so I'm really excited about the following video, hope the following videos will also talk about BERT and fine-tune BERT
@statquest Жыл бұрын
@@thanhtrungnguyen8387 I'll keep that in mind.
@KevinKansas1 Жыл бұрын
The way you explain complex subjects in a easy-to-understand format is amazing! Do you have an idea when will you release a video about transformers? Thank you Josh!
@statquest Жыл бұрын
I'm shooting for the end of the month.
@JeremyHalfon Жыл бұрын
Hi Josh@@statquest , any update on the following? Would definitely need it for my final tomorrow :))
@statquest Жыл бұрын
@@JeremyHalfon I'm finishing my first draft today. Hope to edit it this weekend and record next week.
@mrstriker1847 Жыл бұрын
Please add to the neural network playlist! Or don't it's your video, I just want to be able to find it when I'm looking for it to study for class.
@statquest Жыл бұрын
I'll add it to the playlist, but the best place to find my stuff is here: statquest.org/video-index/
@envynoir Жыл бұрын
Godsent! Just what I needed! Thanks Josh.
@statquest Жыл бұрын
bam!
@weiyingwang2533 Жыл бұрын
You are amazing! The best explanation I've ever found on KZbin.
@statquest Жыл бұрын
Wow, thanks!
@hasansayeed3309 Жыл бұрын
Amazing video Josh! Waiting for the transformer video. Hopefully it'll come out soon. Thanks for everything!
@statquest Жыл бұрын
Thanks! I'm working on it! :)
@imkgb27 Жыл бұрын
Many thanks for your great video! I have a question. You said that we calculate the similarity score between 'go' and EOS (11:30). But I think the vector (0.01,-0.10) is the context vector for "let's go" instead of "go" since the input includes the output for 'Let's' as well as the embedding vector for 'go'. It seems that the similarity score between 'go' and EOS is actually the similarity score between "let's go" and EOS. Please make it clear!
@statquest Жыл бұрын
You can talk about it either way. Yes, it is the context vector for "Let's go", but it's also the encoding, given that we have already encoded "Let's", of the word "go".
@yizhou6877 Жыл бұрын
I am always amazed by your tutorials! Thanks. And when we can expect the transformer tutorial to be uploaded?
@statquest Жыл бұрын
Tonight!
@abrahammahanaim3859 Жыл бұрын
Hey Josh your explanation is easy to understand. Thanks
@statquest Жыл бұрын
Glad it was helpful!
@akashat18368 ай бұрын
Hey Josh! Firstly, Thank you so much for this amazing content!! I can always count on your videos for a better explanation! I have one quick clarification to make. Before the fully dense layer. The first two numbers we get are from the [scaled(input1-cell1) + scaled(input2-cell1) ] and [scaled(input1-cell2) + scaled(input2-cell2) ] right? And the other two numbers are from the outputs of the decoder, right?
@statquest8 ай бұрын
Yes.
@akashat18368 ай бұрын
@@statquest Thank you for the clarification!
@familywu3869 Жыл бұрын
Thank you for the excellent teaching, Josh. Looking forward to the Transformer tutorial. :)
@statquest Жыл бұрын
Coming soon!
@rikki146 Жыл бұрын
When I see new vid from Josh, I know today is a good day! BAM!
@statquest Жыл бұрын
BAM! :)
@abdullahhashmi654 Жыл бұрын
Been wanting this video for so long, gonna watch it soon!
@statquest Жыл бұрын
bam!
@madjohnshaft Жыл бұрын
I am currently taking the AI cert program from MIT - I thank you for your channel
@statquest Жыл бұрын
Thanks and good luck!
@rathinarajajeyaraj1502 Жыл бұрын
Much awaited one .... Awesome as always ..
@statquest Жыл бұрын
Thank you!
@Xayuap Жыл бұрын
weeeeee, video for tonite, tanks a lot
@statquest Жыл бұрын
:)
@lequanghai2k4 Жыл бұрын
I am stilling learning this so hope next video come out soon
@statquest Жыл бұрын
I'm working on it as fast as I can.
@ThinAirElon Жыл бұрын
quadruple BAM !
@statquest Жыл бұрын
Thanks!
@d_b_ Жыл бұрын
Thanks for this. The way you step through the logic is always very helpful
@statquest Жыл бұрын
Thanks!
@JL-vg5yj Жыл бұрын
super clutch my final is on thursday thanks a lot!
@statquest Жыл бұрын
Good luck!
@tangt304 Жыл бұрын
Another awesome video! Josh, will you plan to talk about BERT? Thank you!
@statquest Жыл бұрын
I'll keep that in mind.
@MartinGonzalez-wn4nr Жыл бұрын
Hi Josh, I just bought your books, Its amazing the way that you explain complex things, read the papers after wach your videos is easier. NOTE: waiting for the video of transformes
@statquest Жыл бұрын
Glad you like them! I hope the video on Transformers is out soon.
@abdullahbinkhaledshovo4969 Жыл бұрын
I have been waiting for this for a long time
@statquest Жыл бұрын
Transformers comes out on monday...
@sreerajnr6896 ай бұрын
Your explanation is AMAZING AS ALWAYS!! I have 1 doubt. Do we do the attention calculation only on the final layer? For example, if there are 2 layers in encoder and 2 layers in decoder, we use only the outputs from 2nd layer of encoder and 2nd layer of decoder for attention estimation, right?
@statquest6 ай бұрын
I believe that is correct, but, to be honest, I don't think there is a hard rule.
@souravdey1227 Жыл бұрын
Had been waiting for this for months.
@statquest Жыл бұрын
The wait is over! :)
@방향-o7z8 күн бұрын
목표: encoder의 마지막 토큰인 EOS와의 similarity를 계산해서 decoder의 첫 번째 토큰을 만들자. 11:52 한 토큰에 대해: 다른 토큰 포함해서 모든 토큰 하나씩 층을 만들어서 / 각 토큰층마다 내적곱으로 EOS와의 비슷한정도를 계산. => 각 토큰마다 점수로 나옴. 12:31 그 점수를 softmax로 계산하면 0부터 1까지의 값이 나옴. 더 비슷한 것을 decoder의 첫 번째 토큰 만드는 데 이용하는 것. 13:48 decoder에서 softmax로 다시 계산해서 deocer의 첫 번째 토큰 생성. 중요한 것은 11:52에서 '한 토큰에 대해'서 계산했다는 것. - 원래는 모든 토큰 전체 층을 decoder에 보내서 decoder의 첫 번째 토큰 만드는 데 이용했다면, - attetion은 한 토큰마다 전체 층 내적곱 구해서 decoder의 첫 번째 토큰 만드는 데 이용하는 것.
@statquest8 күн бұрын
bam
@theelysium1597 Жыл бұрын
Since you asked for video suggestions in another video: A video about the EM and Mean Shift algorithm would be great!
@statquest Жыл бұрын
I'll keep that in mind.
@juliank740810 ай бұрын
Phew! Lots of things in this model, my brain feels a bit overloaded, haha But thanks! Might have to rewatch this
@statquest10 ай бұрын
You can do it!
@rishabhsoni Жыл бұрын
Superb Videos. One question, is the fully connected layer just simply the softmax layer, there is no hidden layer with weights (meaning no weights are learned)?
@statquest Жыл бұрын
No, there are weights along the connections between the input and output of the fully connected layer, and those outputs are then pumped into the softmax. I apologize for not illustrating the weights in this video. However, I included them in my video on transformers, and it's the same here. Here's the link to the transformers video: kzbin.info/www/bejne/sKm0qoeBbdaor7s
@rajatjain7894 Жыл бұрын
Was eagerly waiting for this video
@statquest Жыл бұрын
Bam! :)
@owlrion Жыл бұрын
Hey! Great video, this is really helping me with neural networks at the university, do we have a date for when the transformer video comes out?
@statquest Жыл бұрын
Soon....
@andrewsiah Жыл бұрын
Can't wait for the transformer video!
@statquest Жыл бұрын
I'm making great progress on it.
@shamshersingh96803 ай бұрын
Hi Josh, thanks again for awesomest video ever made on Attention models. The video is so wonderfully made that it made such involved concept crystal clear. However, I have one small doubt. Till time step 14:37 you explained the attention with single layer of LSTMs. But what if we have two layers in Encoder and Decoder as we have in previous Seq2Seq Encoder-Decoder video. In that case, how the attention is going to get calculated. My guess is that we will calculate similarity score between LSTM output of second layer for each token with LSTM output of Decoder and feed the final similarity score to Fully Connected Layer along with output of hidden cells of LSTMs of second layer. Or will we calculate similarity score between LSTM output of each layer in Encoder with each layer in Decoder as pass the input to the FC layer along with the output of second layer in Decoder since that is the final output from the Decoder. Thanks a lot again for being our saviour and your presence makes this the best time to learn new things.
@statquest3 ай бұрын
Thank you! I'm pretty sure we would calculate the similarities between each layer in the encoder with each later in the decoder to pass them to a fully connected layer.
@patrikszepesi2903 Жыл бұрын
Hi, great video. At 13:49 can you please explain how you get -.3 and 0.3 for the input to the fully connected? THank you
@statquest Жыл бұрын
The outputs from the softmax function are multiplied with the short-term memories coming out of the encoders LSTM units. We then add those products together to get -0.3 and 0.3.
@handsomemehdi3445 Жыл бұрын
Hello, Thank you for the video, but I am so confused that some terms introduced in original 'Attention is All You Need' paper were not mentioned in video, for example, keys, values, and queries. Furthermore, in the paper, authors don't talk about cosine similarity and LSTM application. Can you please clarify this case a little bit much better?
@statquest Жыл бұрын
The "Attention is all you need" manuscript did not introduce the concept of attention. That does done years earlier, and that is what this video describes. If you'd like to understand the "Attention is all you need" concept of transformers, check out my video on transformers here: kzbin.info/www/bejne/sKm0qoeBbdaor7s
@automatescellulaires8543 Жыл бұрын
wow, i didn't think i would see this kind of stuff on this channel.
@statquest Жыл бұрын
:)
@yoshidasan4780 Жыл бұрын
first of all thanks a lot Josh! you made it way too understandable for us and i would be forever grateful to you for this !! Have a nice time! and can you please upload videos on Bidirectional LSTM and BERT?
@statquest Жыл бұрын
I'll keep those topics in mind.
@aniket_mishrАй бұрын
Thanks for the amazing explanation. TRIPLE BAM!!!
@statquestАй бұрын
:)
@sabaaslam781 Жыл бұрын
Hi Josh! No doubt, you teach in the best way. I have a request, I have been enrolled in PhD and going to start my work on Graphs, Can you please make a video about Graph Neural Networks and its variants, Thanks.
@statquest Жыл бұрын
I'll keep that in mind.
@okay730 Жыл бұрын
I'm excited for the video about transformers. Thank you Josh, your videos are extremely helpful
@statquest Жыл бұрын
Coming soon!
@mymy-bi8ze2 ай бұрын
Thanks as always for your great videos!!! This video was a little difficult for me. Can I ask a stupid question? In 13:31 , the fully connected layer is addressed, out of blue in my understanding. The inputs are attention values and EOS encoding, but how can the fully connected layer, which I think would have no information of translated sentences' encodings, can generate varmos???
@statquest2 ай бұрын
The entire model, the weights and biases in the LSTM units and the weights and biases in the fully connected layer, is trained with backpropagation. So we quantify how similar the output is to the desired output and modify the weights and biases (all of them) based on that, in an iterative way, until we get the desired output.
@mymy-bi8ze2 ай бұрын
@@statquest Thank you so much for your reply! My question is why that fully connected layer is necessary. It isn't needed in Seq2Seq and valinilla LSTM. So I'm wondering why it is necessary in Attention and what its role is.....
@statquest2 ай бұрын
@@mymy-bi8ze We need something to combine the attention values with the values that come out of the decoder LMTMs.
@mymy-bi8ze2 ай бұрын
@@statquest Thank you so much! I went back to Seq2Seq, and it was there too! Now I got it. Thanks again!
@orlandopalmeira6238 ай бұрын
Hello, I have a doubt. The initialization of the cell state and hidden state of the decoder is a context vector that is the representation (generated by encoder) of the entire sentence (input)? And what about each hidden state (from encoder) used in decoder? Are they stored somehow? Thanks!!!
@statquest8 ай бұрын
1) Yes, the context vector is a representation of the entire input. 2) The hidden states in the encoder are stored for attention.
@orlandopalmeira6238 ай бұрын
@@statquest Thanks!!
@andresg3110 Жыл бұрын
You are on Fire! Thank you so much
@statquest Жыл бұрын
Thank you! :)
@Sarifmen Жыл бұрын
13:15 so the attention for EOS is just 1 number (per LSTM cell) which combines references to all the input words?
@statquest Жыл бұрын
Yep.
@sunnywell264 Жыл бұрын
Hi @statquest / @Josh ... This is an amazing video and i had been going through your content. All of those content are some of the best explanations of AI that I have seen till date. In this video towards the end where we are setting the input values of the fully connected layer, i am not able to place the values besides the value of one of the attention value. Please confirm below if I am right: Value from Encoder Layer: let's : -0.76(1st LSTM) | 0.75(2nd LSTM) go: 0.01(1st LSTM) | -0.01(2nd LSTM) Value from Decoder Layer: EOS: 0.91(1st LSTM) | 0.38(2nd LSTM) Similarity Scores: Lets and EOS : (0.91 X -0.76) + (0.38 X 0.75) = -0.6916 + 0.285 = -0.4066 ~ -0.41 go and EOS: (0.91 X 0.01) + (0.38 X -0.01) = 0.0091 + -0.0038 = 0.0053 ~ -0.01 After Softmax Lets and EOS: 0.4 go and EOS: 0.6 Attention Value for 1st LSTM which is rolled twice(for lets and go): -0.76*0.4 + 0.01*06 = -0.298 ~ -0.3 0.75*0.4 + -0.01*0.6 = 0.3 - 0.06 = 0.24 Thus we get the following input values for the fully connected layer: 1. Value from 1st LSTM Layer(Decoder) -> EOS: 0.91 2. Attention Value for 1st LSTM Layer(Encode) wrt EOS -> -0.3 I suppose the following two values are what we get from 2nd LSTM layer which has a different initial values for initial Short term memory and Long Term memory: 3. Value from 2nd LSTM Layer(Decoder) -> EOS: 0.4 Let me know if my understanding is correct Josh.
@statquest Жыл бұрын
What time point, minutes and seconds, are you asking about?
@sunnywell264 Жыл бұрын
13:52@@statquest
@statquest Жыл бұрын
@@sunnywell264 The values are pretty close and probably slightly off due to rounding. Is that what you're worried about or is there something else?
@sunnywell264 Жыл бұрын
Yes... I was worried about the delta in the values. I hope that my calculations above are correct and i am not at fault there.
@statquest Жыл бұрын
@@sunnywell264 It's possible that, internally, my math is not rounding at each stage, so I'd be willing to bet that your math is just fine.
@tupaiadhikari Жыл бұрын
At 13:38 are we Concatenating the output of the attention values and the output of the decoder LSTM for the translated word (EOS in this case) and then using a weights of dimensions (4*4) to convert into a dimension 4 pre Softmax output?
@statquest Жыл бұрын
yep
@statquest Жыл бұрын
If you want to see a more detailed view of what is going on at that stage, check out my video on Transformers: kzbin.info/www/bejne/sKm0qoeBbdaor7s In that video, I go over every single mathematical operation, rather than gloss over them like I do here.
@tupaiadhikari Жыл бұрын
@@statquest Thank You Professor Josh for the clarifications !
@seriousbusiness2293 Жыл бұрын
This is like a Kids show for machine learning lol. Right in the intersection i am Looking for.
@statquest Жыл бұрын
bam!
@shaktisd11 ай бұрын
I have one fundamental question related to how attention model learns, so basically higher attention score is given to those pairs of word which have higher softmax (Q.K) similarity score. Now the question is how relationship in the sentence "The cat didn't climb the tree as it was too tall" is calculated and it knows that in this case "it" refers to tree and not "cat" . Is it from large content of data that the model reads helps it in distinguishing the difference ?
@statquest11 ай бұрын
Yes. The more data you have, the better attention is going to work.
@manuelcortes1835 Жыл бұрын
I have a question that could benefit from clarification: In the final FC layer for word predictions, it is claimed that the Attention Values and 'encodings' are used as input (13:38). By 'encodings', do we mean the short term memories from the top LSTM layer in the decoder?
@statquest Жыл бұрын
Yes. We use both the attention values and the LSTM outputs (short-term memories or hidden states) as inputs to the fully connected layer.
@faysoufox Жыл бұрын
Thank you for this video. Just a comment, your website didn't display well on my phone.
@statquest Жыл бұрын
Noted!
@Rykurex Жыл бұрын
Do you have any courses with start-to-finish projects for people who are only just getting interested in machine learning? Your explanations on the mathematical concepts has been great and I'd be more than happy to pay for a course that implements some of these concepts into real world examples
@statquest Жыл бұрын
I don't have a course, but hope to have one one day. In the meantime, here's a list of all of my videos somewhat organized: statquest.org/video-index/ and I do have a book called The StatQuest Illustrated Guide to Machine Learning: statquest.org/statquest-store/
@alexfeng75 Жыл бұрын
Fantastic video, indeed! Is the attention described in the video the same as in the attention paper? I didn't see the mention of QKV in the video and would like to know whether it was omitted to simplify or by mistake.
@statquest Жыл бұрын
Are you asking about the QKV notation that appears in the "Attention is all you need" paper? That manuscript arxiv.org/abs/1706.03762 , which came out in 2017, didn't introduce the concept of attention for neural networks. Instead it introduces a more advanced topic - Transformers. The original "how to add attention to neural networks" manuscript arxiv.org/pdf/1409.0473.pdf came out in 2015 and did not use the QKV notation that appeared later in the transformer manuscript. Anyway, my video follows the original, 2015, manuscript. However, I'm working on a video that covers the 2017 manuscript right now. And I've got a long section talking all about the QKV stuff in it. That said, in this video, you can think of the output from each LSTM in the decoder as a "Query", and the outputs from each LSTM in the Encoder as the "Keys" and "Values". The "Keys" are used, in conjunction with each "Query" to calculate the Similarity Scores and the "Values" are then scaled by those scores to create the attention values.
@alexfeng75 Жыл бұрын
@@statquest Thanks for the reply, Josh. Yes, I was referring to the 2017 paper. I look forward to your video covering it.
@SaumitraAgrawalB22AI0545 ай бұрын
in the decoder part, the second time when we are passing vamos as input, do we have to calculate the similarity score again? or we should be using the old one only?
@statquest5 ай бұрын
In the decoder we start by calculating the similarity between the token and the input tokens. Then we calculate the similarity between "vamos" and the input tokens. So those are two different similarity calculations.
@saumitragrawal22795 ай бұрын
Thankyou Got it
@paulotcj2 ай бұрын
Hi Josh. Amazing content as always, but this time I couldn't understand the explanation. Usually, I follow every step taking notes, but when it came to the attention and how it behaves I could not make sense of it even after watching multiple times and consulting external material. I wonder if perhaps it is in the cards to make a revision of this video, with a more lengthy sentence to encode and decode. I am trying to get more material from other sources to better understand this. All the best.
@statquest2 ай бұрын
Can you give me specifics about the details you find confusing?
@paulotcj14 күн бұрын
@@statquest Hi Josh! So I did more research and implemented a couple of models from scratch: vanilla RNN, LSTM, and finally Seq2Seq with attention. What was confusing to me, without having implemented anything, were some concepts involving the models I mentioned above, such as: 1 - For models that use context vector, what is its size? 2 - Is the context vector passed at every encoding step of the encoder? 3 - In the attention models, do we pass the hidden state from the encoder to the decoder after every encoding step? So my answers to that is (and correct me if I am wrong): 1 - The context vector is the size of the hidden layer 2 - As far as I know and in the models I worked with, the context vector is only passed once the encoder part is done. 3 - As far as I know and in the models I worked with (again), the collection of hidden states is passed as a bunch after the encoding is done. PART 2 And In addition to that, I was very confused with the model being explained here, but after my Seq2Seq with attention, I think I would summarize the current situation as follows: We encode the sentence: [Let’s, go, ] We start the decoder with: [] Then, using the attention mechanism, we calculate the similarity between the token word already placed in the decoder: [] - and all the words from the encoder. Since we are looking for the next word in the decoder sequence, "Let’s" will have a lower attention score using softmax, while "go" will be higher. Thus, "go" is selected. We pass this through a linear neural network, a softmax function again, and we land with the pick for the word "vamos". We repeat the process again, looking for the next word in the decoder sequence, having: [, "vamos"] and the attention from the decoder, then we land on , and the final sequence is [, "vamos", ].
@statquest14 күн бұрын
@@paulotcj That's great! One minor detail is that the hidden state and the cell state make up the context vector. I've got a pytorch tutorial on this topic coming out with my new book in January.
@The-Martian73 Жыл бұрын
Great, that's really what I was looking for, thanks mr Starmer for the explanation ❤
@statquest Жыл бұрын
bam! :)
@MelideCrippa Жыл бұрын
Thank you very much for your explanation! You are always super clear. Will the transformer video be out soon? I have a natural language processing exam in a week and I just NEED your explanation to go through them 😂
@statquest Жыл бұрын
Unfortunately I still need a few weeks to work on the transformers video... :(
@elmehditalbi8972 Жыл бұрын
Could you do a video about Bert? Architectures like these can be very helpful on NLP and I think a lot of folks will benefit from that :)