Skip to content

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

@apintar

Description

@apintar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions