Logistic Regression Training Loop — medium Optimization problem | Incognition