You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parameters given in the problem I need to optimize are of type namedtuple, for example: (model_1=(a=1.0, b=2.0), model_2=(a=2.0,b=3.0),
The parameters given in the problem I need to optimize are of type namedtuple, for example. But from the tutorial, x0, lb and ub are all Vector types. When I use namedtuple as x0, lb, ub, the code does not work:
using Optimization
rosenbrock(x, p) = (p[1] - x[:a])^2 + p[2] * (x[:b] - x[:a]^2)^2
x0 = (a=0.0, b=0.0)
p = [1.0, 100.0]
using OptimizationBBO
prob = OptimizationProblem(rosenbrock, x0, p, lb=(a=-1.0, b=-1.0), ub=(a=1.0, b=1.0))
sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited())
Also I tried ComponentArray but it still doesn't seem to work:
using Optimization
using ComponentArrays
rosenbrock(x, p) = (p[1] - x[:a])^2 + p[2] * (x[:b] - x[:a]^2)^2
x0 = ComponentVector(a=0.0, b=0.0)
p = [1.0, 100.0]
using OptimizationBBO
prob = OptimizationProblem(rosenbrock, x0, p, lb=ComponentVector(a=-1.0, b=-1.0), ub=ComponentVector(a=1.0, b=1.0))
sol = solve(prob, BBO_adaptive_de_rand_1_bin_radiuslimited())
The text was updated successfully, but these errors were encountered:
Question❓
The parameters given in the problem I need to optimize are of type namedtuple, for example:
(model_1=(a=1.0, b=2.0), model_2=(a=2.0,b=3.0)
,The parameters given in the problem I need to optimize are of type namedtuple, for example. But from the tutorial, x0, lb and ub are all Vector types. When I use namedtuple as x0, lb, ub, the code does not work:
Also I tried ComponentArray but it still doesn't seem to work:
The text was updated successfully, but these errors were encountered: