finish logistic regression with both sgd and cg