-
-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Description
The optimization functions in surrogates mutate the surrogate struct.
To reproduce:
using Surrogates
#sphere function
function s(x)
return sum(x .^ 2)
end
n = 30
d = 3
lb = [-10.0 for i in 1:d]
ub = [10.0 for i in 1:d]
x = sample(n, lb, ub, SobolSample())
y = s.(x)
r = RadialBasis(x, s.(x), lb, ub, rad = linearRadial())
size(r.x) #(30,)
size(r.y) #(30,)
surrogate_optimize(s, SRBF(), lb, ub, r, UniformSample())
size(r.x) #(165,)
size(r.y) #(165,)
Should we be indicating that the function mutates with the ! convention (i.e. surrogate_optimize!(s, SRBF(), lb, ub, r, UniformSample()))?
ablaom and christianhauschel
Metadata
Metadata
Assignees
Labels
No labels