python - Scipy basinhopping not respecting stepsize? -
running following code, on 7th print out of parameter being evaluated (x), parameter jumps 100 .01 despite initial stepsize being set .1 , interval being set 50. how basinhopping able make jump exceeds stepsize such large magnitude?
import multiprocessing mp scipy.optimize import basinhopping def runenvironment(x): return x**2 def func(x): print "x:",x pool = mp.pool(processes=1) results=pool.apply(runenvironment,(x,)) pool.close() return results if __name__ == '__main__': x0=100 ret=basinhopping(func, x0, niter=100, t=1.0, stepsize=.1, minimizer_kwargs=none, take_step=none, accept_test=none, callback=none, interval=50, disp=false, niter_success=none)
basinhopping iterative procedure uses local minimization, takes step in coordinate space (stepsize) local minimization again, different minimum.
the stepsize parameter applies step in coordinate space.
in example default local minimizer (bfgs think) finds global minimum on first iteration. local minimizer uses 7 function evaluations that, it's still within 1 basinhopping iteration. basinhopping doesn't know it's @ global minimum, continues try find better one.
Comments
Post a Comment