| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from gradient_free_optimizers import RandomSearchOptimizer |
||
| 2 | |||
| 3 | |||
| 4 | def test_ackley(): |
||
| 5 | from gradient_free_optimizers._objective_functions._ackley_function import ( |
||
| 6 | AckleyFunction, |
||
| 7 | ) |
||
| 8 | |||
| 9 | ackley = AckleyFunction() |
||
| 10 | |||
| 11 | opt = RandomSearchOptimizer(ackley.search_space) |
||
| 12 | opt.search(ackley.objective_function, n_iter=100) |
||
| 13 | |||
| 14 | |||
| 15 | def test_ackley(): |
||
| 16 | from gradient_free_optimizers._objective_functions._sphere_function import ( |
||
| 17 | SphereFunction, |
||
| 18 | ) |
||
| 19 | |||
| 20 | sphere = SphereFunction(n_dim=3) |
||
| 21 | |||
| 22 | opt = RandomSearchOptimizer(sphere.search_space) |
||
| 23 | opt.search(sphere.objective_function, n_iter=100) |
||
| 24 |