optimise.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tdlstm 作者: bluemonk482 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号