Solver Parameter Tuning (cpmpy.tools.tune_solver)
This file implements parameter tuning for constraint solvers based on SMBO and using adaptive capping. Based on the following paper: Ignace Bleukx, Senne Berden, Lize Coenen, Nicholas Decleyre, Tias Guns (2022). Model-Based Algorithm Configuration with Adaptive Capping and Prior Distributions. In: Schaus, P. (eds) Integration of Constraint Programming, Artificial Intelligence, and Operations Research. CPAIOR 2022. Lecture Notes in Computer Science, vol 13292. Springer, Cham. https://doi.org/10.1007/978-3-031-08011-1_6
Link to paper: https://rdcu.be/cQyWR
Link to original code of paper: https://github.com/ML-KULeuven/DeCaprio
This code currently only implements the author’s ‘Hamming’ surrogate function. The parameter tuner iteratively finds better hyperparameters close to the current best configuration during the search. Searching and time-out start at the default configuration for a solver (if available in the solver class)
- class cpmpy.tools.tune_solver.GridSearchTuner(solvername, model, all_params=None, defaults=None)[source]
Grid search parameter tuner that exhaustively tests all parameter combinations. Inherits from ParameterTuner but uses a simple grid search strategy
- tune(time_limit=None, max_tries=None, fix_params={}, verbose=1)[source]
- Parameters:
time_limit – Time budget to run tuner in seconds. Solver will be interrupted when time budget is exceeded
max_tries – Maximum number of configurations to test
fix_params – Non-default parameters to run solvers with.
verbose – how much information to print (0=none)
- class cpmpy.tools.tune_solver.ParameterTuner(solvername, model, all_params=None, defaults=None)[source]
Parameter tuner based on DeCaprio method [ref_to_decaprio]
- tune(time_limit=None, max_tries=None, fix_params={}, verbose=1)[source]
- Parameters:
time_limit – Time budget to run tuner in seconds. Solver will be interrupted when time budget is exceeded
max_tries – Maximum number of configurations to test
fix_params – Non-default parameters to run solvers with.
verbose – how much information to print (0=none)