def hyperoptTUNE(args, model, n_calls):
"""
Search the hyper-parameter space according to the tree of Parzen estimators;
a Bayesian approach.
"""
hyperparameters = {
'batch_size': hp.choice('batch_size', range(40, 130, 20)),
'num_hidden': hp.quniform('num_hidden', 100, 500, 1),
# 'learning_rate': hp.choice('learning_rate', [0.0005]),
'dropout_output': hp.quniform('dropout_output', 0.3, 1.0, 0.1),
'dropout_input': hp.quniform('dropout_input', 0.3, 1.0, 0.1),
'clip_norm': hp.quniform('clip_norm', 0.5, 1.0, 0.1),
}
data = load_data(args, args.data, saved=args.load_data)
best_params, all_res = hyperopt_search(args, data, model, hyperparameters, max_evals=n_calls)
print(best_params)
评论列表
文章目录