# Are the hyperparameters searched using ray.tune.run() reliable? Why do two runs give different results?

**URL:** <https://discuss.ray.io/t/are-the-hyperparameters-searched-using-ray-tune-run-reliable-why-do-two-runs-give-different-results/10578>\
**Category:** Ray Tune\
**Created:** [May 8, 2023, 8:57pm UTC](https://discuss.ray.io/t/are-the-hyperparameters-searched-using-ray-tune-run-reliable-why-do-two-runs-give-different-results/10578 "2023-05-08T20:57:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hui-zju](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/hui-zju/32/4381_2.png) [@Hui-zju](https://discuss.ray.io/u/Hui-zju)\
**Post date:** [May 8, 2023, 8:57pm UTC](https://discuss.ray.io/t/are-the-hyperparameters-searched-using-ray-tune-run-reliable-why-do-two-runs-give-different-results/10578/1 "2023-05-08T20:57:06Z")

</div>

Are the hyperparameters searched using ray reliable? Why do two runs give different results? The only difference between the two runs is that “batch\_size”: tune.choice([4, 8]) becomes “batch\_size”: tune.choice([4, 8, 16]), but the hyperparameters of the ray search are not the same

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/9/98b7e3defff93b5ee49abebfbabb7bed0e0b48d5.jpeg)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/5/59602b674d4101805be4ec6373a9b72f493ff487.jpeg)

---

<div class="post-metadata">

**Author:** ![yunxuanx](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yunxuanx/32/4354_2.png) [@yunxuanx](https://discuss.ray.io/u/yunxuanx)\
**Post date:** [May 10, 2023, 9:42pm UTC](https://discuss.ray.io/t/are-the-hyperparameters-searched-using-ray-tune-run-reliable-why-do-two-runs-give-different-results/10578/2 "2023-05-10T21:42:46Z")

</div>

Yes. Two runs can be different because the Tuner will sample N trials(in your case N=10) from your `param_space`. Tune offers various functions to define search spaces and sampling methods. You can specify how these values are sampled.

For more information, please refer to this doc: [Key Concepts of Ray Tune — Ray 2.4.0](https://docs.ray.io/en/latest/tune/key-concepts.html#tune-search-spaces)
