Skip to content
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

Box constrained optimization ignores kwargs such as show_trace and iterations #228

Open
apintar opened this issue Mar 5, 2024 · 0 comments

Comments

@apintar
Copy link

apintar commented Mar 5, 2024

When calling optimize! with kernbounds != nothing, kwargs... is ignored.

The relevant line appears to be 32 in the file optimize.jl.

The current line is

results = optimize(func.f, func.df, lb, ub, init, Fminbox(method), args...)

I would propose replacing it with

results = optimize(func, lb, ub, init, Fminbox(method), Optim.Options(;kwargs...))

I've tested this change on a local clone of GaussianProcesses.jl with my own example, and it appears to work as intended. I have not run the tests in the test folder.

For consistency, I would also propose a change in line 28 from

results = optimize(func, init, args...; method=method, kwargs...)     # Run optimizer

to

 results = optimize(func, init, method, Optim.Options(;kwargs...))     # Run optimizer

One thing to note. It's unclear to me what role args... plays, so perhaps my proposed solution overlooks something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant