INFO 51

29 views
Skip to first unread message

Ashwin Khadke

unread,
Apr 11, 2023, 10:58:49 AM4/11/23
to SNOPT
I am running into an INFO 51 error when trying to solve an optimization problem using SNOPT through the Matlab interface. The full output file with verify_level 3 is attached with this email. 

From what I understand this error corresponds to incorrect gradient computation. The specific discrepancy is highlighted in the output as follows
Screen Shot 2023-04-11 at 10.34.53 AM.png
I am analytically computing gradients for my objective function and constraints. The objective and constraints vector F has the following form where x and w are the variables of the optimization

F = [x'Hx + c'x + lambda*norm(w, 1); % objective
       norm(x, 1); % L1 constraint
       A*[x; w] % linear constraint ]

The gradient calculation is performed analytically. 
G = [2*x'*H' + c',   lambda*sign(w');
        sign(x'), zeros(1, length(w));
        A]

I tried to check my objective and constraints function by numerically computing the gradients (central differencing with a step size of 1e-4) and comparing them with those returned by my function and the largest discrepancy I get is of the order of 1e-5 which is nothing close to what SNOPT's gradient checker is reporting. Furthermore, the objective gradient check reports a huge discrepancy in magnitude and sign which is also difficult to understand. 

Additionally, I also provide the structure of the gradient/jacobian to the optimization and I tried comparing my structure with that returned by snJac which also leads to a discrepancy where snJac treats gradients of some of the linear constraints as non-constant (which is also hard to understand since the gradient is simply the constant matrix A in the above description). Furthermore, for different initial points (randomly generated), the snJac output is different (again for the linear constraints!) which is surprising since the linear constraint gradient is (or should be) a constant matrix!

My initial guess to the optimization problem is not feasible and I don't have a good way to provide a feasible initial point in general. When I do try to solve the problem (with the same objective and constraints function) in a trivial setting where I know the optimal solution the optimization returns with INFO 1. Any help in debugging this would be greatly appreciated.

Best,
Ashwin Khadke
output

SNOPT

unread,
Apr 11, 2023, 11:35:09 AM4/11/23
to SNOPT
Can you re-run with option "verify level 3"?  This will check and print out all the derivative results so you can determine which derivatives SNOPT thinks are incorrect.

Ashwin Khadke

unread,
Apr 11, 2023, 11:44:33 AM4/11/23
to SNOPT
I am currently running with verify_level 3 and the output file attached is generated with this option. The screenshot attached in the previous email indicates that the discrepancy occurs in constraint 508 but when I compare the numerical (computed using central differencing with 1e-4 perturbation) and analytical derivatives I don't observe that large of a discrepancy. Furthermore, the objective gradient discrepancy reported by SNOPT also seems really large and with a sign mismatch which also is something I do not observe when I numerically calculate gradients myself.
Reply all
Reply to author
Forward
0 new messages