[Ipopt] new_x

Majewski, Kurt kurt.majewski at siemens.com
Tue Mar 28 05:24:28 EDT 2017


Hello Michel,

I am using the new_x flag to avoid duplicate calculations
in the following way:

I am defining a method which does the common calculations
for the objective value and its derivatives:

prepare(...)
{
	// Perform expensive preparations
	// Store results somewhere...
	mIntermediateValue1 = ...;
	...
}

This can be used in the Ipopt callback functions as follows:

eval_f(...)
{
	...
	if(new_x) prepare(...);

	// Now use intermediate values to calculate objective value
	objectiveValue = objectiveFunction(mInternediateValue1, ...);
	...
}

eval_grad_f(...)
{
	...
	if(new_x) prepare(...);

	// Now use intermediate values to calculate Jacobian
	...
}

eval_h(...)
{
	...
	if(new_x) prepare(...)

	// Now use intermediate values to calculate Hessian
	...
}


In this way the expensive preparations are only performed,
when the x-values change. Typically these callback functions 
are called one after another for the same x-values, 
such that prepare(...) is only called once per iteration.
(But there are exceptions from this scheme...).

Regards,

Kurt Majewski

Siemens AG
Corporate Technology
Research and Technology Center
CT RTC BAM
Otto-Hahn-Ring 6
81739 München, Deutschland
Tel.: +49 89 636-633791
mailto:Kurt.Majewski at siemens.com 

Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme; Vorstand: Joe Kaeser, Vorsitzender; Roland Busch, Lisa Davis, Klaus Helmrich, Janina Kugel, Siegfried Russwurm, Ralf P. Thomas; Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322


-----Ursprüngliche Nachricht-----
Von: Ipopt [mailto:ipopt-bounces at coin-or.org] Im Auftrag von Bierlaire Michel
Gesendet: Tuesday, March 28, 2017 8:11 AM
An: Stefan Vigerske
Cc: ipopt at list.coin-or.org; Bierlaire Michel
Betreff: Re: [Ipopt] new_x


Thank you. 

Yes, I am using quasi-Newton now. But the convergence is quite slow. If calculating the hessian saves a significant number of iterations, it may be worth calculating it. 

I’ll continue to investigate. 

Best regards,

Michel


> On 27 mars 2017, at 16:17, Stefan Vigerske <stefan at math.hu-berlin.de> wrote:
> 
> Hi,
> 
> no, it doesn't tell you that.
> I'm not sure that Ipopt itself always knows at the time of calling eval_f whether it will need the Hessian for that point later.
> 
> If the exact Hessian takes too long, you could try with Ipopt's Hessian approximation instead.
> 
> Stefan
> 
> On 03/27/2017 03:23 PM, Bierlaire Michel wrote:
>> Dear all,
>> 
>> I am using IPOPT through the C++ interface.
>> I am not sure how to use correctly the option “new_x” in the eval_* functions.
>> 
>> My problem calculates a likelihood function by scanning a large database.
>> It means that f takes a long time, g a very long time, and h a huge amount of time.
>> But, when I calculate h, I have f and g almost for free.
>> And when I calculate g, I have f almost for free.
>> 
>> It means that,
>> - for iterations that require f, g and h, I would need to only call h 
>> (and store f and g),
>> - for iterations that require f and g, I would need to call g (and store f).
>> - for iterations that require only f, I would calculate only f.
>> 
>> But how can I use the ’new_x’ mechanism to implement that?
>> The documentation says “The boolean variable new_x will be false if the last call to any of the evaluation methods (eval_*) used the same  values.”
>> I do not want to calculate g and h each time eval_f is called. At the time of the call, how do I know if IPOPT will need g and h for this iteration? new_x does not tell me anything about it, does it?
>> 
>> Thank you for your help.
>> 
>> Best regards,
>> 
>> 
>> Michel Bierlaire
>> Transport and Mobility Laboratory
>> School of Architecture, Civil and Environmental Engineering EPFL - 
>> Ecole Polytechnique Fédérale de Lausanne 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__transp-2Dor.epfl.
>> ch&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BRcuJnQr5
>> NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=hhvyHdDCjciv42IKbEV8uwVYkyDsI2NE
>> CnJKX7WwVM4&s=Mbkh4Y8v5jSGHqz36t2EMQ1QECpQuCNsn7UL1i86qVc&e=
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__people.epfl.ch_mi
>> chel.bierlaire&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4
>> &r=BRcuJnQr5NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=hhvyHdDCjciv42IKbEV8
>> uwVYkyDsI2NECnJKX7WwVM4&s=4oowC93Q5vYUjBHmff36MB57kAtxpNyMBgLZjxnCFdY
>> &e=
>> 
>> 
>> _______________________________________________
>> Ipopt mailing list
>> Ipopt at list.coin-or.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.o
>> rg_mailman_listinfo_ipopt&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5og
>> LxWPA_2Wlc4&r=BRcuJnQr5NAzU29t80hk2rsLc4vrlRySBDabuq0O1ZI&m=hhvyHdDCj
>> civ42IKbEV8uwVYkyDsI2NECnJKX7WwVM4&s=aFF8owccjeV5ErmRjOiJoPsrcqroVi-I
>> bSOf73jNvFU&e=
>> 
> 
> 
> --
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.gams.com_-7Est
> efan&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BieLs4vj
> c9-qnkl-JHtfApx8kv5b4DfUuuhBaJ9CRpQ&m=4jEkiqpXHRMu2arQ5uRAPBx6T1J03JYc
> sVTnZ0_iQDU&s=u2ASaA98CmLGV28N-sXtXsxFLJy9cDvcUaZKF9NJykc&e=

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering EPFL - Ecole Polytechnique Fédérale de Lausanne https://urldefense.proofpoint.com/v2/url?u=http-3A__transp-2Dor.epfl.ch&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BieLs4vjc9-qnkl-JHtfApx8kv5b4DfUuuhBaJ9CRpQ&m=4jEkiqpXHRMu2arQ5uRAPBx6T1J03JYcsVTnZ0_iQDU&s=2wmdhfCP07dPMFDFKKlAORs31vcnAQ8lIgYGS5NLf4U&e=
https://urldefense.proofpoint.com/v2/url?u=http-3A__people.epfl.ch_michel.bierlaire&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BieLs4vjc9-qnkl-JHtfApx8kv5b4DfUuuhBaJ9CRpQ&m=4jEkiqpXHRMu2arQ5uRAPBx6T1J03JYcsVTnZ0_iQDU&s=GMPJvkCEcZbv8LK6HQfkZqBf2UF9opm1XYJaZH3ydWg&e= 


_______________________________________________
Ipopt mailing list
Ipopt at list.coin-or.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=BieLs4vjc9-qnkl-JHtfApx8kv5b4DfUuuhBaJ9CRpQ&m=4jEkiqpXHRMu2arQ5uRAPBx6T1J03JYcsVTnZ0_iQDU&s=bp8_Efc6SDyyCk0AEZ63Z7OvryHYPQtOpXKoVEubLl0&e= 



More information about the Ipopt mailing list