# How are the parameters $\alpha_i$ of hard attention trained?

I have a question about Show, Attend and Tell: Neural Image CaptionGeneration with Visual Attention paper by Xu. The basic mechanism of stochastic hard attention is that each pixel of the input image has a corresponding parameter $$\alpha_i$$, which describes the probability that this pixel will be chosen for further processing.

But I don't see an explanation of how to train or define this parameter in the paper. Can someone explain how to train this $$\alpha_i$$ for each pixel?