mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 09:44:50 +08:00
[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:
committed by
Richard Liaw
parent
f987572795
commit
5ce670cb36
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user