question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

optimize.differential_evolution: possibility to pass parameters to the polish function

See original GitHub issue

Other global minimization functions already support this option like shgo with minimizer_kwargs or dual_annealing with local_search_options for instance. However, differential_evolution only support toggling on and off this minimization with the polish parameter. It would be great to have the possibility to choose the method as well as any other parameter that the method supports.

Moreover, I propose that the same name for this parameter is used for all other algorithms of this type being the name minimizer_kwargs the most clarifying in my opinion.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
tupuicommented, Feb 25, 2021

After reading both sides, I have three remarks:

  1. There is indeed a discrepancy between the way we can customize the polishing/minimizer and this should be fixed. IMO, it is up to the user to say if an unbounded optimizer would fit better in their case. We can still provide with a default we think is working ok.
  2. If polishing with L-BFGS-B add a small value, is a bit arbitrary as a choice, and we don’t want to add options, then why not completely remove it? This would be clearer and we could highlight in the doc that you can go with another optimization loop if wanted. Because in the end, we don’t really take advantage to be in the function and have the function evaluations around to help the last minimization (no precomputed gradient, etc.).
  3. Adding an intermediate local minimization is another story and IMO should be considered as a separate thing.

So I would either go for completely removing the polishing, or having a coherent interface with the other functions as suggested by @labay11.

0reactions
mdhabercommented, Oct 9, 2022

There are a lot of good points here, but since this has been inactive, I thought I’d suggest something that may be a reasonable compromise and doesn’t require much decision-making: instead of deprecating polish or adding a new parameter minimize_kwargs parameter, why don’t we allow the user to pass an optimizer callable (that satisfies the minimize interface) into the existing polish keyword?

Of course, this is so much more convenient to the user than for the user to just pass the output of differential_evolution into the local optimizer themselves. But then again, neither is the minimizer_kwargs of the existing PR, and hopefully, this suggestion is less contentious since we can reuse the existing polish keyword, it’s 100% customizable, and it’s backward compatible, so we don’t have to do the work of a deprecation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.optimize.differential_evolution — SciPy v1.9.3 Manual
The algorithm is due to Storn and Price [1]. The objective function to be minimized. Must be in the form f(x, *args) ,...
Read more >
scipy.optimize.differential_evolution
Finds the global minimum of a multivariate function. Differential Evolution is stochastic in nature (does not use gradient methods) to find the ...
Read more >
How to pass/access variables used inside objective function in ...
I'm using DE to optimize a Neural Network problem. And i need to access variables inside the object function to create a plot....
Read more >
Differential Evolution Global Optimization With Python | MKAI
Differential Evolution is a global optimization algorithm. It is a type of evolutionary algorithm and is related to other evolutionary ...
Read more >
How To Use Python Scipy Differential Evolution
The module scipy.optimize has a method differential_evolution() that finds a multivariate function's global minimum. The syntax is given below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found