A logistic regression algorithm used to classify mnist handwritten digits