tests/test_empty_output/verbose.py 1 location
|
@@ 5-15 (lines=11) @@
|
2 |
|
from gradient_free_optimizers import RandomSearchOptimizer |
3 |
|
|
4 |
|
|
5 |
|
def ackley_function(para): |
6 |
|
x, y = para["x"], para["y"] |
7 |
|
|
8 |
|
loss = ( |
9 |
|
-20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y))) |
10 |
|
- np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y))) |
11 |
|
+ np.exp(1) |
12 |
|
+ 20 |
13 |
|
) |
14 |
|
|
15 |
|
return -loss |
16 |
|
|
17 |
|
|
18 |
|
search_space = { |
tests/test_empty_output/non_verbose.py 1 location
|
@@ 57-67 (lines=11) @@
|
54 |
|
] |
55 |
|
|
56 |
|
|
57 |
|
def ackley_function(para): |
58 |
|
x, y = para["x"], para["y"] |
59 |
|
|
60 |
|
loss = ( |
61 |
|
-20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y))) |
62 |
|
- np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y))) |
63 |
|
+ np.exp(1) |
64 |
|
+ 20 |
65 |
|
) |
66 |
|
|
67 |
|
return -loss |
68 |
|
|
69 |
|
|
70 |
|
search_space = { |