Passed
Push — master ( 79bd2c...57729f )
by Simon
01:39
created

gradient_free_optimizers._objective_functions.tests.test_objective_functions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_ackley() 0 9 1
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