logistic regression gradient descent python from scratch