Neural Turing Machine - how the shifting works? I am reading the paper on Neural Turing Machine, page 9, and got stuck on just 1 pesky point.
I can't understand how the shift is done:

Each head emits a shift weighting $\vec{s_t}$ that defines a normalized distribution over the allowed integer shifts (Authors mean entries in s will add up to 1). For example, if shifts between -1 and 1 are allowed, $\vec{s_t}$ has three elements corresponding to the degreee to which shifts of -1, 0 and 1 are performed.
If we index the $N$ memory locations from 0 to $N-1$, the rotation applied to $\vec{w_t^g}$ by $\vec{s_t}$ can be expressed as the following circular convolution:
$$w_{new}(i) \leftarrow \sum_{j=0}^{N-1}w^g_t(j)s_t(i-j)$$
where all index arithmetic is computed modulo $N$.

The authors use notation $w_t(i)$ to signify i'th element in the vector.
I cannot understand how $s_t$ is applied to the $w^g_t$ and what makes it possible to actually perform shift, say by +1

For example, assume we are working on the the i'th element that is at index 3 and $w^g_t$ has 5 entries.
Like in the paper, let's allow $s$ to be able to perform a shift of -1, 0 or 1. Thus, $s$ has 3 dimensions. Now, I want to shift every element in $w$ by +1 forward.
I have a feeling I will get out of bounds error, and modulo won't help too much. We can unfold this computation for the 3rd element:
w[3] = wg[0]*s[(3-0)%5] + wg[1]*s[(3-1)%5] + wg[2]*s[(3-2)%5] + wg[3]*s[(3-3)%5] + wg[4]*s[(3-4)%5] 

when simplified this means:
w[3] = wg[0]*s[3] + wg[0]*s[2] + wg[0]*s[1] + wg[0]*s[0] + wg[0]*s[4]

As you can see, I got s[3] at the start and s[4] at the end. ...But we've just agreed s will only have 3 entries {-1, 0, 1} and this means out of bounds error.
And, I can't really understand how what we've done would &quot;shift&quot; the entire $w^g$ into $w_{new}$ once we do it for all 5 entries (we've done the above just for 3rd entry). Can someone give me the intuition for it as well?
Ok, it makes sense if we don't think about the formula

Look at the bottom half of the following slide, taken from Page 20, "Neural Turing Machine" side-presentation by Kiho Suh; June 19, 2017