Neural network from scratch python mnist