You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that scipy.optimize.shgo is failing on certain one-dimensional cases (see example below) with the default simplicial sampling. Based on the apparent 3-point sampling used (x=a, x=(a+b)/2, and x=b where the bounds are [(a,b)]), I suspect this issue will manifest for the nontrivial set of functions / domains where f(a)=f((a+b)/2)=f(b).
In the case below, x=0, x=0.5, and x=1 are sampled, and the function values at these points are all zero. As can be seen, when run with sobol sampling, the issue is not encountered.
So I suspect this is a sampling issue that may be related either directly or indirectly to #10429.
@Stefan-Endres You marked that gh-16313 would close this, but the original code still fails; the user must pass n explicitly (e.g. n=101 to solve the problem. Is this problem pathological, or is it reasonable to keep this enhancement request (for shgo to solve the problem with default settings) open? Or is changing default n something you wanted to do in that follow-up PR?
This is true, the previous defaults masked this I should have checked more carefully what the actual issue here was (which was previously also solved by forcing one minimisation per iteration, but this had to be taken out to match the benchmarks of scipy main).
I will unmark it and make a enchancement PR at a later date so that we do not clog the already large PR with more detailed technical discussion.
It appears that
scipy.optimize.shgo
is failing on certain one-dimensional cases (see example below) with the default simplicial sampling. Based on the apparent 3-point sampling used (x=a
,x=(a+b)/2
, andx=b
where the bounds are[(a,b)]
), I suspect this issue will manifest for the nontrivial set of functions / domains wheref(a)=f((a+b)/2)=f(b)
.In the case below, x=0, x=0.5, and x=1 are sampled, and the function values at these points are all zero. As can be seen, when run with
sobol
sampling, the issue is not encountered.So I suspect this is a sampling issue that may be related either directly or indirectly to #10429.
Reproducing code example:
Scipy/Numpy/Python version information:
Tagging @Stefan-Endres in case he has any thoughts.
The text was updated successfully, but these errors were encountered: