fix bugs of linear and logistic regression

update parameters of theta simutaneously.