where $ W_s $, $ W_h $, and $ v $ are learned parameters. The attention weights are obtained by applying softmax: