implement sgd based logistic regression