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 (Experiment | Mapping | Sequence[Experiment | Mapping]) – Experiments to run. Each experiment can be an Experiment instance or a mapping describing one.

  • scheduler (TrialScheduler | None) – Optional trial scheduler used to manage trial execution.

  • verbose (int | AirVerbosity | Verbosity | None) – Verbosity level forwarded to tune.run.

  • progress_reporter (ProgressReporter | None) – Optional progress reporter forwarded to tune.run.

  • resume (bool | str | None) – Resume option forwarded to tune.run.

  • resume_config (ResumeConfig | None) – Optional resume configuration forwarded to tune.run.

  • reuse_actors (bool) – Whether to reuse actors between trials.

  • raise_on_failed_trial (bool) – Raise TuneError if any trial fails.

  • concurrent (bool) – If True, run all experiments concurrently. If False, run them sequentially.

  • callbacks (Sequence[Callback] | None) – Optional list of callbacks forwarded to tune.run.

  • _remote (bool | None) – 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.