You are given the encoder hidden states h1,h2,h3∈R2 and the decoder hidden state s2∈R2 at time step t=2.
Use **dot-product attention**, where the attention score is computed as:
etj=st⊤hjandαtj=∑k=13exp(etk)exp(etj)
The context vector is then computed as:
ct=∑j=13αtjhj
Use the following values:
s2=[10],h1=[12],h2=[01],h3=[23]
Note: Use approximate values of exponential exp(1)≈2.72, exp(2)≈7.39, etc.
Answer the given subquestions: