ML: Working Neural Network with MNIST data

My method of grad descent doesnt work, but the other optimization works