Logistic regression using kaggle digits. Getting nan for output