[Ipopt] derivative checker

Andreas Waechter andreasw at watson.ibm.com
Mon Nov 22 09:46:27 EST 2010


Hi Andre,

Yes, Sebastian is correct.  Since the starting point might be somewhat 
special (e.g., lots of zeros), we do a random perturbation of this point 
before doing the finite difference derivative checker.  After the test, 
however, the starting point from which Ipopt starts should be just what 
you specified.

There is an option that determines by how much the starting point is 
modified before the finite difference test, and you can simple set this 
one to zero if you prefer to have the derivative test being one exactly at 
the point you provide.  The name of this options is 
point_perturbation_radius.

Regards,

Andreas

On Sun, 14 Nov 2010, Sebastian Nowozin wrote:

> Dear Andre,
>
> I am not sure about the internals of IpOpt and thus might be wrong,
> but the way the derivative checker works is by computing the
> finite-difference approximation of the gradient by evaluating the
> objective function at perturbations of the starting point.  It
> compares this approximation with the "analytic" gradient provided by
> your function.
> Therefore, what you see might simply be perturbed starting points used
> by the derivative checker.
>
> Sebastian
>
> On Sun, Nov 14, 2010 at 1:57 PM, loerx <loerx at uni-trier.de> wrote:
>> Hi,
>>
>> I have some problems with the derivative checker. I provided a starting
>> point of (0.25, -0.4, 0.5, 1), however, ipopt performs a derivative check at
>> (-9.7249748222296830, 0.87170628986480203, -5.6339152195806754,
>> 7.1748100222785105).
>> The starting point seems to be right until the function IpoptSolve is
>> called. Then for some reasons the starting point changes and after the
>> derivative check Ipopt starts the optimization with the right starting
>> point.
>>
>> Code:
>>
>> ...
>>
>> /* create the IpoptProblem */
>> nlp = CreateIpoptProblem(n, x_L, x_U, m, NULL, NULL, 0, 0, 0, &eval_f,
>> &eval_g, &eval_grad_f, &eval_jac_g, &eval_h);
>>
>> AddIpoptStrOption(nlp, "hessian_approximation", "limited-memory");
>> AddIpoptStrOption(nlp, "derivative_test", "first-order");
>> AddIpoptStrOption(nlp, "derivative_test_print_all", "yes");
>>
>> /* allocate space for the initial point and set the values */
>> x = (Number*)malloc(sizeof(Number)*n);
>> for (k = 0; k < n; k++)
>> {
>> 	x[k] = Iparameter[k];
>> }
>>
>> /* allocate space to store the bound multipliers at the solution */
>> mult_x_L = (Number*)malloc(sizeof(Number)*n);
>> mult_x_U = (Number*)malloc(sizeof(Number)*n);
>>
>> /* solve the problem */
>> status = IpoptSolve(nlp, x, NULL, &obj, NULL, mult_x_L, mult_x_U, NULL);
>>
>> /* free allocated memory */
>> FreeIpoptProblem(nlp);
>>
>> ...
>>
>>
>> Any Idea, how to perform the derivative check at the starting point, would
>> be very helpful.
>>
>> Best regards,
>> Andre
>>
>> _______________________________________________
>> Ipopt mailing list
>> Ipopt at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/ipopt
>>
>>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>
>



More information about the Ipopt mailing list