|
1 | 1 | using Surrogates |
2 | 2 | using LinearAlgebra |
3 | 3 | using QuasiMonteCarlo |
| 4 | +using SurrogatesSVM |
4 | 5 | #######SRBF############ |
5 | 6 | ##### 1D ##### |
6 | 7 |
|
@@ -86,16 +87,15 @@ my_linear_ND = LinearSurrogate(x, y, lb, ub) |
86 | 87 | surrogate_optimize(objective_function_ND, SRBF(), lb, ub, my_linear_ND, SobolSample(), |
87 | 88 | maxiters = 15) |
88 | 89 |
|
89 | | -#= |
90 | 90 | #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 |
| 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 |
95 | 95 | 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 | | -=# |
| 96 | +my_SVM_ND = SVMSurrogate(x, y, lb, ub) |
| 97 | +surrogate_optimize( |
| 98 | + objective_function_ND, SRBF(), lb, ub, my_SVM_ND, SobolSample(), maxiters = 15) |
99 | 99 |
|
100 | 100 | #Inverse distance surrogate |
101 | 101 | lb = [1.0, 1.0] |
@@ -276,26 +276,24 @@ num_centers = 2 |
276 | 276 | surrogate_optimize(objective_function_ND, SOP(num_centers), lb, ub, my_k_SOPND, |
277 | 277 | SobolSample(), maxiters = 20) |
278 | 278 |
|
279 | | -#multi optimization |
280 | | -#= |
281 | | -f = x -> [x^2, x] |
| 279 | +f = x -> [x^2, x] |
282 | 280 | lb = 1.0 |
283 | 281 | ub = 10.0 |
284 | | -x = sample(100, lb, ub, SobolSample()) |
285 | | -y = f.(x) |
| 282 | +x = sample(100, lb, ub, SobolSample()) |
| 283 | +y = f.(x) |
286 | 284 | my_radial_basis_smb = RadialBasis(x, y, lb, ub, rad = linearRadial()) |
287 | | -surrogate_optimize(f,SMB(),lb,ub,my_radial_basis_ego,SobolSample()) |
| 285 | +surrogate_optimize(f, SMB(), lb, ub, my_radial_basis_smb, SobolSample()) |
288 | 286 |
|
289 | | -f = x -> [x^2, x] |
| 287 | +f = x -> [x, sin(x)] |
290 | 288 | lb = 1.0 |
291 | 289 | ub = 10.0 |
292 | | -x = sample(100, lb, ub, SobolSample()) |
293 | | -y = f.(x) |
| 290 | +x = sample(500, lb, ub, RandomSample()) |
| 291 | +y = f.(x) |
294 | 292 | my_radial_basis_rtea = RadialBasis(x, y, lb, ub, rad = linearRadial()) |
295 | 293 | Z = 0.8 #percentage |
296 | 294 | K = 2 #number of revaluations |
297 | 295 | p_cross = 0.5 #crossing vs copy |
298 | 296 | n_c = 1.0 # hyperparameter for children creation |
299 | 297 | sigma = 1.5 # mutation |
300 | | -surrogate_optimize(f,RTEA(Z,K,p_cross,n_c,sigma),lb,ub,my_radial_basis_rtea,SobolSample()) |
301 | | -=# |
| 298 | +surrogate_optimize(f, RTEA(K, Z, p_cross, n_c, sigma), lb, ub, |
| 299 | + my_radial_basis_rtea, SobolSample(); maxiters = 10) |
0 commit comments