gradient term for regularized logistic regression