配置概览#

Train 中的运行配置 (RunConfig)#

RunConfig 是 Ray Train 中用于定义对应于 trainer.fit() 调用的实验规范的配置对象。

它包括实验名称、结果存储路径、停止条件、自定义回调、检查点配置、详细级别和日志选项等设置。

这些设置中的许多是通过其他配置对象配置的,并通过 RunConfig 传递。以下小节包含这些配置的描述。

运行配置的属性是不可调优的

import os

from ray.train import RunConfig

run_config = RunConfig(
    # Name of the training run (directory name).
    name="my_train_run",
    # The experiment results will be saved to: storage_path/name
    storage_path=os.path.expanduser("~/ray_results"),
    # storage_path="s3://my_bucket/tune_results",
    # Stopping criteria
    stop={"training_iteration": 10},
)

另请参阅

请参阅 RunConfig API 参考。

请参阅 配置持久存储,获取存储配置示例(与 storage_path 相关)。