Passed
Push — master ( bac9d4...455948 )
by Simon
04:25
created

tests.test_optimizers.test_parameter.test_hill_climbing_para_init   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_hill_climbing_para() 0 3 1
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import pytest
6
7
8
from gradient_free_optimizers import HillClimbingOptimizer
9
from ._base_para_test import _base_para_test_func
10
11
12
hill_climbing_para = [
13
    ({"epsilon": 0.0001}),
14
    ({"epsilon": 1}),
15
    ({"epsilon": 10}),
16
    ({"epsilon": 10000}),
17
    ({"distribution": "normal"}),
18
    ({"distribution": "laplace"}),
19
    ({"distribution": "logistic"}),
20
    ({"distribution": "gumbel"}),
21
    ({"n_neighbours": 1}),
22
    ({"n_neighbours": 10}),
23
    ({"n_neighbours": 100}),
24
    ({"rand_rest_p": 0}),
25
    ({"rand_rest_p": 0.5}),
26
    ({"rand_rest_p": 1}),
27
    ({"rand_rest_p": 10}),
28
]
29
30
31
pytest_wrapper = ("opt_para", hill_climbing_para)
32
33
34
@pytest.mark.parametrize(*pytest_wrapper)
35
def test_hill_climbing_para(opt_para):
36
    _base_para_test_func(opt_para, HillClimbingOptimizer)
37