-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAINT: clarify dual_annealing-minimizer_kwargs docstring. Closes #20614 #20676
Conversation
rng = np.random.default_rng(94253637693657847462) | ||
def f(x, power): | ||
return np.sum(np.exp(x ** power)) | ||
|
||
def jac(x, power): | ||
return np.exp(x ** power) * power * x ** (power - 1) | ||
|
||
def hess(x, power): | ||
# calculated using WolframAlpha as d^2/dx^2 e^(x^p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it by hand first :-). Do you use WolframAlpha at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the time to get reference values of special/stats functions. Sometimes need to use Mathematics proper if it's not provided with Alpha.
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Could/should args
be removed from minimizer_kwargs
if it is present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment inline.
Yeah, I saw that |
Closes #20614
This PR explains more clearly how keyword arguments are passed to a local minimiser as part of
dual_annealing
.As part of understanding how the minimizer_kwargs is passed to
minimize
I realised that ifargs
are provided to the originaldual_annealing
call, then they were automatically provided tofunc
and possiblyjac
using a wrapping approach, and therefore don't need to be specified inminimizer_kwargs
. The PR therefore states not to includeargs
in that dict. I then realised that the same wrapping mechanism should be implemented forhess
andhessp
, and did that as well.