Scores can be any real numbers, but attention needs weights that are positive and sum to one, so the model can average the encoder states. A softmax does that: it exponentiates each score and normalizes.
Implement attention_weights(scores), a numerically stable softmax over the score vector.
Subtract scores.max() first, exponentiate, then divide by the sum.
No results yet
Run your code to check it against the examples, or submit to run every test.