Discussion:
[NLopt-discuss] Verbose option in Python
Artem
2016-01-18 19:41:42 UTC
Permalink
Hello everyone,

Could you please tell me if it is possible to set the verbose mode
for NLopt in Python and if so, how do I do that?
Unfortunately, I haven't been able to find an answer in the documentation
or by searching the internet, though I could find a mention of the verbose
mode in Python on this discussion board (already e-mailed that person directly).

Things like opt.verbose=1/True/whatever do not raise any errors but do not seem
to affect the level of output in any way.

Thanks a lot in advance!

Sincerely,
Artem.
Yury V. Zaytsev
2016-01-18 20:53:42 UTC
Permalink
Could you please tell me if it is possible to set the verbose mode for
NLopt in Python and if so, how do I do that?
What would you actually expect from the verbose mode? You can log the
vectors that NLopt passes to your objective function from the callbacks.
--
Sincerely yours,
Yury V. Zaytsev
Artem
2016-01-18 21:36:18 UTC
Permalink
Thank you for your response Yury!
I was hoping to get a bit more (than just catching ValueError or some other
exception) info on why certain algorithms (e.g., all the global ones) fail
to execute at all or fail after apparently spending quite some time on
a problem (based on the time it takes and the activity of the objective
function).

I did try to figure that out from the vectors but with no success.

A friend of mine is telling me with verbose mode on in C he could get
a lot of useful diagnostic information when such problems appeared
but switching to C would be a bit of an overkill if there is a simple way
to turn verbose mode on in Python (might still need to do that if there
isn't).

Thanks,
Artem.

Yury V. Zaytsev <***@...> writes:


What would you actually expect from the verbose mode? You can log the
vectors that NLopt passes to your objective function from the callbacks.
Steven G. Johnson
2016-01-18 23:52:11 UTC
Permalink
There is no verbose option in Python. Just include a print statement in your objective function; that's all the verbose option in the Matlab interface does anyway.
Post by Artem
Hello everyone,
Could you please tell me if it is possible to set the verbose mode
for NLopt in Python and if so, how do I do that?
Unfortunately, I haven't been able to find an answer in the documentation
or by searching the internet, though I could find a mention of the verbose
mode in Python on this discussion board (already e-mailed that person directly).
Things like opt.verbose=1/True/whatever do not raise any errors but do not seem
to affect the level of output in any way.
Thanks a lot in advance!
Sincerely,
Artem.
_______________________________________________
NLopt-discuss mailing list
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
Artem
2016-01-19 07:00:11 UTC
Permalink
Post by Steven G. Johnson
There is no verbose option in Python. Just include a print statement in your
objective function; that's all the verbose option in the Matlab interface does
anyway.
Thank you Steven.

A friend of mine told me when he screwed up the derivatives with one
of the gradientmethods the C interface he used detected that and
complained about the mismatch. I don't have issues with derivative
methods but was hoping perhaps other methods
could also be more specific on why they might fail to proceed.

It would be a pity if they don't.

Thanks again!
Steven G. Johnson
2016-01-19 16:29:55 UTC
Permalink
The next version of NLopt will have more specific error messages in many cases, although it is impossible to automatically diagnose all possible failures. If your derivatives are wrong, that is especially likely to cause unexplained problems.
Post by Artem
Post by Steven G. Johnson
There is no verbose option in Python. Just include a print statement in your
objective function; that's all the verbose option in the Matlab interface does
anyway.
Thank you Steven.
A friend of mine told me when he screwed up the derivatives with one
of the gradientmethods the C interface he used detected that and
complained about the mismatch. I don't have issues with derivative
methods but was hoping perhaps other methods
could also be more specific on why they might fail to proceed.
It would be a pity if they don't.
Thanks again!
_______________________________________________
NLopt-discuss mailing list
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss
Artem
2016-01-19 22:43:40 UTC
Permalink
Post by Steven G. Johnson
The next version of NLopt will have more specific error messages in many
cases, although it is impossible to
automatically diagnose all possible failures. If your derivatives are wrong,
that is especially likely
to cause unexplained problems.
Thank you very much Steven!

Sincerely,
Artem.

Loading...