Bahdanau et al. (2014) let a decoder look back at every encoder state when producing each output word. The alignment score measures how relevant each encoder state is to the decoder's current state, using a small learned network.
Implement additive_scores(s, H, W, U, v), which returns one score per encoder state: v . tanh(W s + U h_j).
H has shape (T, d_h).Broadcast the decoder state against every encoder row, apply tanh, then dot with v.
No results yet
Run your code to check it against the examples, or submit to run every test.