We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug 🐞
Using certain solvers, one cannot change the state of the optimization in the callback function
Expected behavior
The state to be updateable in the callback function
Minimal Reproducible Example 👇
using Optimization, OptimizationOptimJL rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2 x0 = zeros(2) p = [1.0, 100.0] optf = OptimizationFunction(rosenbrock, AutoFiniteDiff()) prob = Optimization.OptimizationProblem(optf, x0, p) function callback(state, loss) state.u .= 0 false end sol = solve(prob, Optimization.LBFGS(), callback=callback) # changes state sol = solve(prob, OptimizationOptimJL.LBFGS(), callback=callback) # does not change state
Environment (please complete the following information):
using Pkg; Pkg.status()
[7f7a1694] Optimization v4.0.5 [36348300] OptimizationOptimJL v0.4.1
versioninfo()
Julia Version 1.10.7 Commit 4976d05258 (2024-11-26 15:57 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: 16 × 12th Gen Intel(R) Core(TM) i5-1240P WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-15.0.7 (ORCJIT, alderlake) Threads: 10 default, 0 interactive, 5 GC (on 16 virtual cores) Environment: JULIA_EDITOR = code JULIA_NUM_THREADS = 10
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug 🐞
Using certain solvers, one cannot change the state of the optimization in the callback function
Expected behavior
The state to be updateable in the callback function
Minimal Reproducible Example 👇
Environment (please complete the following information):
using Pkg; Pkg.status()
versioninfo()
The text was updated successfully, but these errors were encountered: