[tune] Add Initial Parameter Suggestion for HyperOpt (#3944)

Allows users of the HyperOptSearch suggestion algorithm to specify initial experiment values to run (typically already known good baseline parameters within the domain specified)
This commit is contained in:
markgoodhead
2019-02-07 18:57:51 +00:00
committed by Richard Liaw
parent f987572795
commit 5ce670cb36
2 changed files with 56 additions and 11 deletions
+18 -1
View File
@@ -43,6 +43,19 @@ if __name__ == '__main__':
'activation': hp.choice("activation", ["relu", "tanh"])
}
current_best_params = [
{
"width": 1,
"height": 2,
"activation": 0 # Activation will be relu
},
{
"width": 4,
"height": 2,
"activation": 1 # Activation will be tanh
}
]
config = {
"my_exp": {
"run": "exp",
@@ -55,6 +68,10 @@ if __name__ == '__main__':
},
}
}
algo = HyperOptSearch(space, max_concurrent=4, reward_attr="neg_mean_loss")
algo = HyperOptSearch(
space,
max_concurrent=4,
reward_attr="neg_mean_loss",
points_to_evaluate=current_best_params)
scheduler = AsyncHyperBandScheduler(reward_attr="neg_mean_loss")
run_experiments(config, search_alg=algo, scheduler=scheduler)