-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathheatmap_test.py
43 lines (35 loc) · 1.14 KB
/
heatmap_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
sys.path.append('..')
from OptimizationTestFunctions import Sphere, Ackley, AckleyTest, Rosenbrock, Fletcher, Griewank, Penalty2, Quartic, Rastrigin, SchwefelDouble, SchwefelMax, SchwefelAbs, SchwefelSin, Stairs, Abs, Michalewicz, Scheffer, Eggholder, Weierstrass, plot_3d
dim = 2
funcs = [
Sphere(dim, degree = 2),
Ackley(dim),
AckleyTest(dim),
Rosenbrock(dim),
Fletcher(dim, seed = 1488),
Griewank(dim),
Penalty2(dim),
Quartic(dim),
Rastrigin(dim),
SchwefelDouble(dim),
SchwefelMax(dim),
SchwefelAbs(dim),
SchwefelSin(dim),
Stairs(dim),
Abs(dim),
Michalewicz(),
Scheffer(dim),
Eggholder(dim),
Weierstrass(dim)
]
for f in funcs:
plot_3d(f,
points_by_dim= 70,
title = type(f).__name__,
bounds=None,
show_best_if_exists= False,
save_as = None,#f"heatmap for {type(f).__name__}.png",
cmap = 'twilight',
plot_surface = True,
plot_heatmap = True)