Ray Tune:调度程序和搜索算法如何交互? [英] Ray Tune: How do schedulers and search algorithms interact?

查看:261
本文介绍了Ray Tune:调度程序和搜索算法如何交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,将超频带与贝叶斯优化搜索集成在一起的自然方法是让搜索算法确定每个托架,并让超频带调度程序运行托架.也就是说,贝叶斯优化搜索每个括号仅运行一次.查看 Tune

It seems to me that the natural way to integrate hyperband with a bayesian optimization search is to have the search algorithm determine each bracket and have the hyperband scheduler run the bracket. That is to say, the bayesian optimization search runs only once per bracket. Looking at Tune's source code for this, it's not clear to me whether the Tune library applies this strategy or not.

尤其是,我想知道Tune库如何处理搜索算法和试用计划程序之间的传递.例如,如果我按以下方式一起调用SkOptSearch和AsyncHyperBandScheduler(或HyperBandScheduler),这将如何工作:

In particular, I want to know how the Tune library handles passing between the search algorithm and trial scheduler. For instance, how does this work if I call SkOptSearch and AsyncHyperBandScheduler (or HyperBandScheduler) together as follows:

sk_search = SkOptSearch(optimizer,
 ['group','dimensions','normalize','sampling_weights','batch_size','lr_adam','loss_weight'],
 max_concurrent=4,
 reward_attr="neg_loss",
 points_to_evaluate=current_params)

hyperband = AsyncHyperBandScheduler(
        time_attr="training_iteration",
        reward_attr="neg_loss",
        max_t=50,
        grace_period=5,
        reduction_factor=2,
        brackets=5
        )

run(Trainable_Dense,
    name='hp_search_0',
    stop={"training_iteration": 9999,
         "neg_loss": -0.2},
    num_samples=75,
    resources_per_trial={'cpu':4,'gpu':1},
    local_dir='./tune_save',
    checkpoint_freq=5,
    search_alg=sk_search,
    scheduler=hyperband,
    verbose=2,
    resume=False,
    reuse_actors=True)

基于上面链接的源代码和源代码,在我看来sk_search一次最多返回4个试验的组,但是超频带应该一次在sk_search算法中查询N_sizeofbracket试验.

Based on the source code linked above and the source code here, it seems to me that sk_search would return groups of up to 4 trials at a time, but hyperband should be querying the sk_search algorithm for N_sizeofbracket trials at a time.

推荐答案

Tune中现在有一个贝叶斯优化HyperBand实现-

There is now a Bayesian Optimization HyperBand implementation in Tune - https://ray.readthedocs.io/en/latest/tune-searchalg.html#bohb.

对于标准搜索算法和调度程序,搜索算法当前仅在完成试验后才能看到试验结果.

For standard search algorithms and schedulers, the search algorithm currently only sees the result of a trial if it is completed.

这篇关于Ray Tune:调度程序和搜索算法如何交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆