tubetranscript.io

NPTEL IIT Guwahati · Transcript · · Updated

Lec 24: Transformers - I – Transcript

Video by NPTEL IIT Guwahati · Watch the original on YouTube

Summary

AI-generated from the transcript. Verify details against the source video.

  • The encoder-decoder model encodes the meaning of a full image into a fixed-length context vector to pass to the decoder.
  • Attention enables a neural network to dynamically identify and use the most relevant information from a set of inputs when producing an output.
  • The attention mechanism allows the decoder to dynamically access all encoder hidden states instead of relying solely on a single context vector.
Video thumbnail: Lec 24: Transformers - I
Source video on YouTube · Transcript generated automatically and may contain errors.

Use this video with Pro

Reading, copying and transcript downloads are free. Create saved AI results for this video with a signed-in Pro account ($9/month).

Transcript

Search ignores accents. All transcript text stays visible.

Hello and welcome to the lecture transformer part one. In this lecture, we're going to discuss the special context in computer vision problems.

Then we take example of image captioning with context modeling and finally we introduce attention or image captioning problem.

Today we start transformer. Now before start transformer I would like to recapitulate some concept of sequence to sequence modeling using RN LST what we have discussed in understanding of RNL.

So what we have shown for this RNN based sequencetose sequence model that there are basically two major thing one is encoder RNA and other is decoder and

the idea is basically From one sequence, we actually try to translate to the other sequence. maybe from different language to another different language

and in between there is a context vector and what we have described that the RNN so this is the four sequence or four word sentence and whatever the meaning or extract of the sentence

is basically gathered or represent this context vector. It is the actually the hidden state after the final encoding node of the encoder RN or LST.

So as a conceptual understanding we can say that this context vector is essentially carrying out the all the meanings of this input sentence where each word are given to this the respective time instances of this RNN.

And this context vector is basically supplied or it is ordered to this decoder or decoder RNA as it is the initial the state input

and then decoder RNN. So what is important here that this context vector is essentially carrying the major abstract or the meaning of this sentence and it is been forwarded to the decoder.

There is another thing that decoder there is basically no input. So the output at the each step becoming the input to the next step that is also a characteristic of okay so if by reading out these statements in RNN LSTM encoder decoder model each

state had access to the current input as well as the information from the previous process inputs As the sequence is processed, information from S0 to ST1 to ST1 is carried forward in a compressed representation with a hidden state at the time step t.

Consequently, this compensation is called context vector. The encoder's final state known as the context vector. They expected to capture the essential information of the input sequence that what we said and this context vector is then passed to a decoder to generate the output

sequence. So that is the essentiality of context vector. Okay. Now we are going to discuss a very interesting problem of computer vision that is image caption.

And here this image captioning problem we try to model with RNN with the special context modeling that what exactly we have done for the sequencetosequence model.

Now the question come why we take this? Because this is a typical computer vision problem. Actually to be very specific it's a kind of vision to text modeling where a image is being inputed and

a sequence of word that is called caption is being outputed. Now, image captioning combines computer vision and natural language processing to generate a textual description of an image that we'll see in subsequent slides how

this image captioning is being modeled by RNA using the special context modeling or special context. Now in this RNM based approach, first a CNN is used to extract the visual features from the image.

while a special context modeling preserves information about where objects and regions are located. So when we use a CNN we have a visual features and these visual features are basically kind of a

description of the whole image. Now this special context or the special context modeling actually preserve information regarding the objects and where this object are being located.

So the regions that information is being taken. Consequently, as per our previous approach, this context vector which basically have the information about object and regions

is the encoder's final hidden state. The encoder's final output is known as context vector is expected to capture the essential information of the entire input image.

And this context vector which have this essential information of the entire input image is passed to the decoder to generate the output sequence.

Now we have to take a example and try to understand that how actually things are being modeled using this special context modeling or image captioning problem using RNN whatever we have seen before.

Now it is a very important that there is a image a boy waving a flag. Now what is this is the image we can understand?

What is our target output? Target output some words or sequence of words having some description of the image.

Let this description boy waving flag such kind of now what is your input in this problem this image.

Now what I said a CNN being employed to extract the important features from so these are the this is the input let's say 3 + 3 if there is a bigger image first special jone is this 3 + 3 maybe other

stones are there and it will be a next time instant will come to the RN or there is a some feature what we put in case finding this so the output of this sequence of the words this scan the image briefly

so here we can see what is the role of CNN that it extract the pictures Okay. Or a portion of the features. Now a MLP is used

Frequently asked questions

The context vector is essentially carrying all the meanings of the input sentence and represents the extract or abstract meaning gathered from the encoder RNN or LSTM to be forwarded to the decoder.

A fixed-length context vector struggles to represent complex characteristics or inter-attribute relationships when dealing with complicated images containing multiple objects and interactions.

Attention calculates alignment scores for encoder hidden states, converts these scores into normalized attention weights using a softmax function, and computes a weighted sum.