Grid Search¶
-
class
deepobs.tuner.
GridSearch
(optimizer_class, hyperparam_names, grid, ressources, runner)[source]¶ Bases:
deepobs.tuner.tuner.ParallelizedTuner
A basic Grid Search tuner.
-
__init__
(optimizer_class, hyperparam_names, grid, ressources, runner)[source]¶ Parameters: grid (dict) -- Holds the discrete values for each hyperparameter as lists.
-
generate_commands_script
(testproblem, run_script, output_dir='./results', random_seed=42, generation_dir='./command_scripts', **kwargs)¶ Parameters: - testproblem (str) -- Testproblem for which to generate commands.
- run_script (str) -- Name the run script that is used from the command line.
- output_dir (str) -- The output path where the execution results are written to.
- random_seed (int) -- The random seed for the tuning.
- generation_dir (str) -- The path to the directory where the generated scripts are written to.
Returns: The relative file path to the generated commands script.
Return type: str
-
generate_commands_script_for_testset
(testset, *args, **kwargs)¶ Generates command scripts for a whole testset. :param testset: A list of the testproblem strings. :type testset: list
-
tune
(testproblem, output_dir='./results', random_seed=42, rerun_best_setting=False, **kwargs)¶ Tunes the optimizer on the test problem. :param testproblem: The test problem to tune the optimizer on. :type testproblem: str :param output_dir: The output directory for the results. :type output_dir: str :param random_seed: Random seed for the whole truning process. Every individual run is seeded by it. :type random_seed: int :param rerun_best_setting: Whether to automatically rerun the best setting with 10 different seeds. :type rerun_best_setting: bool
-
tune_on_testset
(testset, *args, **kwargs)¶ Tunes the hyperparameter on a whole testset. :param testset: A list of testproblems. :type testset: list
-