On Aug 16, 2010, at 12:50 PM, Greg Nicholas wrote:
It is often useful for diagnostic or tracking purposes to print out information about the progress of an optimization at each iteration. Some libraries (e.g. pylab.optimize) allow for a callback function to be defined for that should handle any per- iteration processing like this.

For some simpler algorithms, putting this code in the objective function makes sense, but for others that might make many "exploratory" calls to the objective function without taking an actual step (e.g. gradient algorithms), this will produce a large amount of undesired noise that is often indistinguishable from the desired output.

Are there any work-arounds that I'm unaware of, and if not, any plans for this kind of functionality in the future?


If the purpose is just to track whether the optimization is making progress, and how fast, just using the objective function for this purpose seems reasonable enough to me. After all, if you are tracking progress, you probably want to know if the algorithm is just cycling around some point for a long time without making much progress. And if you want to filter it so that you only show points that improve upon the objective, it is easy for the user to do that herself.

Can you more precisely define a situation in which the objective function itself does not have enough information to do the desired processing?

The only thing I can think of is if you have nonlinear constraints, and you want to know the sequence of "best so far" points (which count only feasible points, or points that at least improve feasibility), in which case you would have to keep track of what both the objective function and the constraints returned, which would be somewhat annoying. I can certainly add another callback function that is called for each "best so far" point. But this is different from the "iteration" metric that you suggest (to the extent that "iterations" is at all a well-defined concept).

Steven

_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to