Mnist Single Layer Neural Network Python