-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_gob_tools.py
More file actions
37 lines (32 loc) · 1021 Bytes
/
test_gob_tools.py
File metadata and controls
37 lines (32 loc) · 1021 Bytes
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
#
# Created in 2024 by Gaëtan Serré
#
from gob import GOB
from gob.benchmarks import PyGKLS, create_bounds, augment_dimensions
import inspect
import gob.benchmarks as gb
n_particles = 15
iter = 10
sigma = 1 / n_particles**2
dim = 2
if __name__ == "__main__":
pygkls = PyGKLS(dim, 15, [-100, 100], -100, smoothness="ND")
benchmarks = []
bounds = []
for name, obj in inspect.getmembers(gb, inspect.isclass):
if name != "PyGKLS":
benchmarks.append(obj())
bounds.append(augment_dimensions(benchmarks[-1].visual_bounds, dim))
benchmarks.append(pygkls)
bounds.append(create_bounds(dim, -99, 99))
gob = GOB(
[
("Langevin", {"n_particles": n_particles, "iter": iter}),
("SBS", {"n_particles": n_particles, "iter": iter, "sigma": sigma}),
("CBO", {"n_particles": n_particles, "iter": iter}),
],
benchmarks[:3],
[],
bounds=bounds,
)
gob.run(n_runs=5, verbose=1, latex_table=True)