Hard attention in Pytorch

Hi everyone,

I’ve been trying to find an implementation of the stochastic “hard” attention described in the seminal work of Xu et al (Show, Attend, and Tell) but so far I have only come across a Tensorflow implementation (https://github.com/uzaymacar/attention-mechanisms). I find it strange that no one has open-sourced this widely known attention mechanism. Please let me know if I have missed something :slight_smile: Thank you!

Check this link.

Hey! Thanks for the reply. Indeed that is an excellent repository :slight_smile: However, unfortunately, they do not implement hard attention.

None of the 37 implementations implemented hard attention.