This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: scipy's differential_evolution bug
Type: Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, mmyara
Priority: normal Keywords:

Created on 2020-05-09 20:43 by mmyara, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg368540 - (view) Author: Mike (mmyara) Date: 2020-05-09 20:43
I have a random bug with scipy's optimize . 
I use it in the context of SageMath (Python 3.7.3).
I checked 3 algorithms  : shgo, dual_annealing and full_optimize.
All don't work well (at all !).

I optimise with a 3 parameters functions with given bounds. The algorithm randomly sends to my error function the "1e-8" value for any of the 3 parameters. I displayed the vector + error to understand it. AS you can see, in this case, the first parameter is 1e-8 whereas it is outside the bounds. Sometimes it happens for the second parameter, or the 3rd ....

------
[3.95049282e-19 3.03055607e-20 1.96212098e+29] 0.0030238733573031864
[3.95273920e-19 3.05821352e-20 1.90997635e+29] 0.002957956545311753
[3.95037412e-19 3.04080173e-20 1.93312145e+29] 0.0029572689364709224
sage.all_cmdline:33: IntegrationWarning: The occurrence of roundoff error is detected, which prevents 
  the requested tolerance from being achieved.  The error may be 
  underestimated.
[1.00000000e-08 3.04080173e-20 1.93312145e+29] 1.0713560755245306
Overflow
[3.95037412e-19 3.04080173e-20 1.93312145e+29] 0.0029572689364709224
-----
The behaviour is the same for all of them. However the value inserted is not always the same, I noticed 3 : 1e-10, 1e-8 and 1.49011612e-08

Moreover, all do not send nice values. For example, the full_optimize always send values close to the highest bound. Perhaps are the value computed with a simple linear average and I guess it should not be the case.

my bounds are :
bounds = [(1*e,4*e),(0.1*e,0.5*e),(1e5,1e40)]
with e=1.6e-19

Is there an alternative for optimization in python ?

regards,
    Mike
msg368543 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-05-09 21:06
SciPy and Sage are 3rd party extensions to CPython and not maintained by us. Please report the issue with SciPi, https://www.scipy.org/scipylib/bug-report.html
msg368546 - (view) Author: Mike (mmyara) Date: 2020-05-09 21:16
ok thank you Christian. I will do.

> Le 9 mai 2020 à 23:06, Christian Heimes <report@bugs.python.org> a écrit :
> 
> 
> Christian Heimes <lists@cheimes.de> added the comment:
> 
> SciPy and Sage are 3rd party extensions to CPython and not maintained by us. Please report the issue with SciPi, https://www.scipy.org/scipylib/bug-report.html
> 
> ----------
> nosy: +christian.heimes
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue40581>
> _______________________________________
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84761
2020-05-09 21:16:45mmyarasetmessages: + msg368546
2020-05-09 21:06:28christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg368543

resolution: third party
stage: resolved
2020-05-09 20:43:17mmyaracreate