You are given the encoder hidden states h1,h2,h3∈R2 and the decoder hidden state s2∈R2 at time step t=2.
Use **additive attention**, where the alignment score is computed as:
etj=va⊤tanh(W1st+W2hj)andα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]
W1=[1001],W2=[1111],va=[1−1]
Hint: Approximate values of tanh(x): tanh(0)=0, tanh(1)≈0.76, tanh(2)≈0.96, tanh(3)≈0.995, tanh(4)≈0.9993, tanh(5)≈0.9999, tanh(6)≈0.99999
Answer the given subquestions: