Skip to content

Commit 95d0445

Browse files
test: uncomment optimization tests
1 parent 33358ba commit 95d0445

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

test/optimization.jl

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,15 @@ my_linear_ND = LinearSurrogate(x, y, lb, ub)
8686
surrogate_optimize(objective_function_ND, SRBF(), lb, ub, my_linear_ND, SobolSample(),
8787
maxiters = 15)
8888

89-
#=
9089
#SVM
91-
lb = [1.0,1.0]
92-
ub = [6.0,6.0]
93-
x = sample(5,lb,ub,SobolSample())
94-
objective_function_ND = z -> 3*norm(z)+1
90+
lb = [1.0, 1.0]
91+
ub = [6.0, 6.0]
92+
x = sample(5, lb, ub, SobolSample())
93+
objective_function_ND = z -> 3 * norm(z) + 1
9594
y = objective_function_ND.(x)
96-
my_SVM_ND = SVMSurrogate(x,y,lb,ub)
97-
surrogate_optimize(objective_function_ND,SRBF(),lb,ub,my_SVM_ND,SobolSample(),maxiters=15)
98-
=#
95+
my_SVM_ND = SVMSurrogate(x, y, lb, ub)
96+
surrogate_optimize(
97+
objective_function_ND, SRBF(), lb, ub, my_SVM_ND, SobolSample(), maxiters = 15)
9998

10099
#Inverse distance surrogate
101100
lb = [1.0, 1.0]
@@ -276,26 +275,24 @@ num_centers = 2
276275
surrogate_optimize(objective_function_ND, SOP(num_centers), lb, ub, my_k_SOPND,
277276
SobolSample(), maxiters = 20)
278277

279-
#multi optimization
280-
#=
281-
f = x -> [x^2, x]
278+
f = x -> [x^2, x]
282279
lb = 1.0
283280
ub = 10.0
284-
x = sample(100, lb, ub, SobolSample())
285-
y = f.(x)
281+
x = sample(100, lb, ub, SobolSample())
282+
y = f.(x)
286283
my_radial_basis_smb = RadialBasis(x, y, lb, ub, rad = linearRadial())
287-
surrogate_optimize(f,SMB(),lb,ub,my_radial_basis_ego,SobolSample())
284+
surrogate_optimize(f, SMB(), lb, ub, my_radial_basis_smb, SobolSample())
288285

289-
f = x -> [x^2, x]
286+
f = x -> [x, sin(x)]
290287
lb = 1.0
291288
ub = 10.0
292-
x = sample(100, lb, ub, SobolSample())
293-
y = f.(x)
289+
x = sample(500, lb, ub, RandomSample())
290+
y = f.(x)
294291
my_radial_basis_rtea = RadialBasis(x, y, lb, ub, rad = linearRadial())
295292
Z = 0.8 #percentage
296293
K = 2 #number of revaluations
297294
p_cross = 0.5 #crossing vs copy
298295
n_c = 1.0 # hyperparameter for children creation
299296
sigma = 1.5 # mutation
300-
surrogate_optimize(f,RTEA(Z,K,p_cross,n_c,sigma),lb,ub,my_radial_basis_rtea,SobolSample())
301-
=#
297+
surrogate_optimize(f, RTEA(K, Z, p_cross, n_c, sigma), lb, ub,
298+
my_radial_basis_rtea, SobolSample(); maxiters = 10)

0 commit comments

Comments
 (0)