I'm trying to minimize multivariate function with SciPy optimization minimize function. The code I'm using to call the function:
res = minimize(self.score_gradient, self.initialized_theta, (x,y),'newton-cg', jac = True, tol = 1e-6, options = {'maxiter':100 ,'disp':True })
score_gradient
calculates the score and the jacobian/gradient. The jacobian/gradient was checked numerically. The score printed in command line after calculation, and I see the following in command line:
3.3275625564
3.34459750933
3.32755781796
3.34459750933
3.32755307725
3.34459750933
3.32754833425
3.34459750933
3.32754358897
3.34459750933
3.32753884139
3.34459750933
3.3275340915
3.34459750933
3.32752933931
3.34459750933
As you can see there is one calculation giving the same result and other minimizing the score as expected. But the function stuck in this calculation for more than half a day, while in MATLAB this calculation takes no more than couple of hours. I know that MATLAB was probably using different optimization algorithm. Somebody saw this behavior and can point what I am doing wrong?