andim / noisyopt

Python library for optimizing noisy functions.
http://noisyopt.readthedocs.io/
MIT License
89 stars 15 forks source link

Example that I can't make work #14

Closed microprediction closed 1 year ago

microprediction commented 3 years ago

Simple 1-d noisy function fails to optimize

https://gist.github.com/microprediction/fe8aa1705595de25c836290cc7afe64f

vishalmhjn commented 3 years ago

AFAIK, SPSA may need some tinkering with the default parameter, for It to work right

andim commented 1 year ago

Please excuse my slow reply, I had missed your comment!

Indeed this is a problem with the parameter choice. In particular the step size needs to be scaled down. The initial step size is controlled by the parameter a. Setting it to a small value, e.g. 1e-3 leads to a correct minimization.

https://gist.github.com/andim/474d4c8203f0b26c988eff878a822405