Hi,
The problem is in the computation of your loss, you have a 1/N which in python2 is equal to 0. And so the value of your loss is alway 0 and independant of your network. Replacing it with 1./N should fix the problem.