for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# Author: Simon Blanke
# Email: [email protected]
# License: MIT License
import pytest
import numpy as np
from gradient_free_optimizers import TabuOptimizer
from .test_hill_climbing_para_init import hill_climbing_para
from ._base_para_test import _base_para_test_func
def objective_function(para):
score = -para["x1"] * para["x1"]
return score
search_space = {"x1": np.arange(-100, 101, 1)}
tabu_search = hill_climbing_para + [
({"tabu_factor": 1}),
({"tabu_factor": 2}),
({"tabu_factor": 2.5}),
({"tabu_factor": 10}),
]
pytest_wrapper = ("opt_para", tabu_search)
@pytest.mark.parametrize(*pytest_wrapper)
def test_hill_climbing_para(opt_para):
_base_para_test_func(opt_para, TabuOptimizer)