def test_config_constant(self):
     search_space = {"a": 1}
     tuner = RandomSearchTuner(None, None, seed=123)
     configs = list(
         tuner.config_generator(search_space, rng=tuner.rng, max_search=10))
     self.assertEqual(len(configs), 1)
예제 #2
0
 def test_config_unbounded_max_search(self):
     search_space = {"a": [1], "b": [1, 2, 3], "c": {"range": [1, 10]}}
     tuner = RandomSearchTuner(None, None, 123)
     configs = list(tuner.config_generator(search_space, max_search=0))
     self.assertEqual(len(configs), 3)
예제 #3
0
 def test_config_list(self):
     search_space = {"a": [1, 2]}
     tuner = RandomSearchTuner(None, None, seed=123)
     configs = list(tuner.config_generator(search_space, max_search=10))
     self.assertEqual(len(configs), 2)
예제 #4
0
 def test_config_two_values(self):
     search_space = {"a": [1], "b": [1, 2, 3]}
     tuner = RandomSearchTuner(None, None, 123)
     configs = list(tuner.config_generator(search_space, max_search=10))
     self.assertEqual(len(configs), 3)
예제 #5
0
 def test_config_range(self):
     search_space = {"a": [1], "b": [1, 2, 3], "c": {"range": [1, 10]}}
     tuner = RandomSearchTuner(None, None, seed=123)
     configs = list(
         tuner.config_generator(search_space, rng=tuner.rng, max_search=10))
     self.assertEqual(len(configs), 10)