<p>As you pointed out, <a href="https://arxiv.org/abs/1410.5401" rel="nofollow">Neural Turing Machines</a> seem to working well to learn the basic algorithms. For instance, the repeat copy task which has been implemented in the paper, might tell us that NTM can learn the algorithm itself. As of now, NTMs have been used only for simple tasks so understanding its scope by using the pow(x,n) will be interesting given that repeat copy works well. I suggest reading <a href="https://arxiv.org/pdf/1505.00521v3.pdf" rel="nofollow">Reinforcement Learning Neural Turing Machines - Revised</a> for a deeper understanding. </p>

<p>Also, recent developments in the area of <code>Memory Networks</code> empower us to perform more complicated tasks. Hence,  to make a neural network understand pow(x,n) might be possible. So go ahead and give it a shot!</p>
How to model a for loop in a neural network
<p>I am currently in the process of learning neural networks and can understand basic examples like AND, OR, Addition, Multiplication, etc.</p>

<p>Right now, I am trying to build a neural network that takes two inputs x and n, and computes pow(x, n). And, this would require the neural network to have some form of a loop, and I am not sure how I can model a network with a loop</p>

<p>Can this sort of computation be modelled on a neural network? I am assuming it is possible.. based on the recently released paper(Neural Turing Machine), but not sure how. Any pointers on this would be very helpful.</p>

<p>Thanks!</p>