test_ackley()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nop 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