Mainly changed Logistic Regression

Combined weights update and gradients update. Therefore in a single double loop, weigths and gradients will be updated simultaneously.