Skip to content

Commit d36adb5

Browse files
committed
Extended hyperparmeter tuning with 4 more strategies
1 parent 638d216 commit d36adb5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

kernel_tuner/hyper.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,30 @@ def put_if_not_present(target_dict, key, value):
114114
hyperparams = {
115115
'method': ['COBYLA', 'L-BFGS-B', 'SLSQP', 'CG', 'Powell', 'Nelder-Mead', 'BFGS', 'trust-constr'],
116116
}
117+
elif strategy_to_tune.lower() == "diff_evo":
118+
hyperparams = {
119+
'method': ["best1bin", "best1exp", "rand1exp", "randtobest1exp", "best2exp", "rand2exp", "randtobest1bin", "best2bin", "rand2bin", "rand1bin"],
120+
'popsize': [10, 20, 30],
121+
'maxiter': [50, 100, 150],
122+
}
123+
elif strategy_to_tune.lower() == "basinhopping":
124+
hyperparams = {
125+
'method': ["Nelder-Mead", "Powell", "CG", "BFGS", "L-BFGS-B", "TNC", "COBYLA", "SLSQP"],
126+
'T': [0.5, 1.0, 1.5],
127+
}
128+
elif strategy_to_tune.lower() == "genetic_algorithm":
129+
hyperparams = {
130+
'method': ["single_point", "two_point", "uniform", "disruptive_uniform"],
131+
'popsize': [10, 20, 30],
132+
'maxiter': [50, 100, 150],
133+
'mutation_chance': [5, 10, 20]
134+
}
135+
elif strategy_to_tune.lower() == "mls":
136+
hyperparams = {
137+
'neighbor': ["Hamming", "adjacent"],
138+
'restart': [True, False],
139+
'randomize': [True, False]
140+
}
117141
else:
118142
raise ValueError(f"Invalid argument {strategy_to_tune=}")
119143

0 commit comments

Comments
 (0)