Skip to content

Commit

Permalink
Fixing OD unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeratyoy committed Aug 24, 2023
1 parent d20e5a7 commit 8f00437
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ def test_kde():
assert config['bandwidth'] == pytest.approx(15.2274, abs=0.001)
assert result['function_value'] == pytest.approx(0.14409, abs=0.0001)


def test_ae():
from hpobench.container.benchmarks.od.od_benchmarks import ODAutoencoder
seed = 10
seed = 100
benchmark = ODAutoencoder("cardio", rng=seed)

config = benchmark.get_configuration_space(seed=seed).sample_configuration()
print(config)
result = benchmark.objective_function(configuration=config, rng=seed)
assert config["dropout"], "Dropout not True"
print(config['dropout_rate'], result['function_value'])

assert config['dropout_rate'] == pytest.approx(0.20237, abs=0.00001)
assert result['function_value'] == pytest.approx(0.4017, abs=0.0001)
assert config['dropout_rate'] == pytest.approx(0.23821, abs=0.00001)
assert result['function_value'] == pytest.approx(0.22132, abs=0.0001)

0 comments on commit 8f00437

Please sign in to comment.