2

我是新来使用 Ray Tune。我将我的光线配置定义如下:

ray_config = {
        "estimator/dropout_rate": tune.uniform(0.0, 0.3),
        "estimator/d_model": tune.choice([64]),
        "estimator/num_encoder_layers": tune.choice([3]),
        "estimator/context_length": tune.choice([4, 8, 12]),
        "trainer/batch_size": tune.choice([256]),
        "trainer/learning_rate": tune.uniform(0.0002, 0.01),
        "trainer/weight_decay": tune.uniform(1e-06, 1e-03)
    }

所以,我试着用这个配置来运行我的曲子。

tune.run(run_or_experiment=executor_run(hpo_params),
         metric="MAE",
         mode="max",
         num_samples=40, # number of trial models
         config=hpo_params,
         fail_fast=True)

但是,当我在函数中看到配置值时executor_run,它没有浮点或整数类型。

'estimator/dropout_rate': <ray.tune.sample.Flo...d87cf7070>

我怎样才能解决这个问题?:(

4

1 回答 1

0

你必须通过run_or_experiment=executor_run(不带括号)。如果保留括号,该函数将立即执行。你真正想要做的是传递一个引用,Ray Tune 然后可以在远程工作人员上执行。

于 2021-07-21T15:37:43.563 回答