ray.tune.run_experiments#
- ray.tune.run_experiments(experiments: Experiment | Mapping | Sequence[Experiment | Mapping], scheduler: TrialScheduler | None = None, verbose: int | AirVerbosity | Verbosity | None = None, progress_reporter: ProgressReporter | None = None, resume: bool | str | None = None, resume_config: ResumeConfig | None = None, reuse_actors: bool = False, raise_on_failed_trial: bool = True, concurrent: bool = True, callbacks: Sequence[Callback] | None = None, _remote: bool | None = None)[source]#
Runs and blocks until all trials finish.
Example
>>> from ray.tune.experiment import Experiment >>> from ray.tune.tune import run_experiments >>> def my_func(config): return {"score": 0} >>> experiment_spec = Experiment("experiment", my_func) >>> run_experiments(experiments=experiment_spec) >>> experiment_spec = {"experiment": {"run": my_func}} >>> run_experiments(experiments=experiment_spec)
- Parameters:
experiments – Experiments to run. Each experiment can be an
Experimentinstance or a mapping describing one.scheduler – Optional trial scheduler used to manage trial execution.
verbose – Verbosity level forwarded to
tune.run.progress_reporter – Optional progress reporter forwarded to
tune.run.resume – Resume option forwarded to
tune.run.resume_config – Optional resume configuration forwarded to
tune.run.reuse_actors – Whether to reuse actors between trials.
raise_on_failed_trial – Raise
TuneErrorif any trial fails.concurrent – If True, run all experiments concurrently. If False, run them sequentially.
callbacks – Optional list of callbacks forwarded to
tune.run._remote – Internal. Whether to run the Tune driver in a remote function. Enabled automatically in Ray client mode.
- Returns:
List of Trial objects, holding data for each executed trial.