# \[Tune\] \[RLlib\] Episodes vs iterations vs trials vs experiments

**URL:** <https://discuss.ray.io/t/tune-rllib-episodes-vs-iterations-vs-trials-vs-experiments/2092>\
**Category:** RLlib\
**Created:** [May 7, 2021, 2:56pm UTC](https://discuss.ray.io/t/tune-rllib-episodes-vs-iterations-vs-trials-vs-experiments/2092 "2021-05-07T14:56:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![geekyneuro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/geekyneuro/32/964_2.png) [@geekyneuro](https://discuss.ray.io/u/geekyneuro)\
**Post date:** [May 7, 2021, 2:56pm UTC](https://discuss.ray.io/t/tune-rllib-episodes-vs-iterations-vs-trials-vs-experiments/2092/1 "2021-05-07T14:56:13Z")

</div>

In the context of RLLib and Tune, where can I find the relationship between these concepts please?

---

<div class="post-metadata">

**Author:** ![sven1977](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sven1977/32/53_2.png) [@sven1977](https://discuss.ray.io/u/sven1977)\
**Post date:** [June 3, 2021, 1:58pm UTC](https://discuss.ray.io/t/tune-rllib-episodes-vs-iterations-vs-trials-vs-experiments/2092/2 "2021-06-03T13:58:16Z")

</div>

Hey @geekyneuro , great question and sorry for the late response due to this question being uncategorized (it’ll help us find questions much faster if you categorize them as e.g. “RLlib”).

Episode: In an RL environment, the episode starts when you call `env.reset()` and it finishes (after n timesteps for each of which you call env.step([some action])) when the env returns the done=True flag from the step() method.

Iteration: A single training iteration for an RLlib Trainer (calling Trainer.train() once). An iteration may contain one or more episodes (collecting data for the train batch or for a replay buffer), and one or more SGD update steps, depending on the particular Trainer being used.

Trial: When you use RLlib in combination with Tune and e.g. do a tune.grid\_search over 2 learning rates, e.g. tune.grid\_search([0.0001, 0.0005]), Tune will then run two “trials” using these two different learning rates.

Experiment: A (e.g. yaml) defined RLlib config (maybe containing grid\_searches that cause n trials). You can store more than one experiment in a yaml file under different top-level experiment names (e.g. see `ray.release.rllib_tests.learning_tests.major_algos_learning_tests.yaml`).
