The hard variant of attention in Show, Attend and Tell samples one location per word rather than averaging. It is not differentiable, so the paper trains it with a score-function gradient estimator.
Implement sample_hard_attention(alpha, rng), drawing one location from the attention distribution.
rng for reproducibility.Call the generator's choice with the attention distribution as probabilities.
No results yet
Run your code to check it against the examples, or submit to run every test.