# Tune: Some hyper parameters format are not good for search algorithm

**URL:** <https://discuss.ray.io/t/tune-some-hyper-parameters-format-are-not-good-for-search-algorithm/90>\
**Category:** Ray Tune\
**Created:** [November 27, 2020, 2:53pm UTC](https://discuss.ray.io/t/tune-some-hyper-parameters-format-are-not-good-for-search-algorithm/90 "2020-11-27T14:53:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingambe](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ingambe/32/52_2.png) [@ingambe](https://discuss.ray.io/u/ingambe)\
**Post date:** [November 27, 2020, 2:53pm UTC](https://discuss.ray.io/t/tune-some-hyper-parameters-format-are-not-good-for-search-algorithm/90/1 "2020-11-27T14:53:43Z")

</div>

How do you perform a hyperparameter search with RLLib?  
One problem I face is the format of the config parameter  
For example, the ‘fcnet\_hiddens’ is an array of each layer size, but, often we want the same size for each layer.  
Maybe give the possibility to tune the number of layers and the size of each layer as an independent parameter?

Also, the schedule config is not suitable for some search algorithms.  
HyperOpt struggles with the “lr\_schedule” and “entropy\_schedule” config because it’s a matrix.

What’s your take on it?

---

<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:** [November 27, 2020, 3:11pm UTC](https://discuss.ray.io/t/tune-some-hyper-parameters-format-are-not-good-for-search-algorithm/90/2 "2020-11-27T15:11:59Z")

</div>

Thanks for the question. Let’s tag this a tune question (I have actually wondered about this problem myself 🙂 ).

---

<div class="post-metadata">

**Author:** ![ingambe](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ingambe/32/52_2.png) [@ingambe](https://discuss.ray.io/u/ingambe)\
**Post date:** [November 27, 2020, 3:56pm UTC](https://discuss.ray.io/t/tune-some-hyper-parameters-format-are-not-good-for-search-algorithm/90/3 "2020-11-27T15:56:47Z")

</div>

Yes, it’s more correct to tag it as a tune question.

To overcome this, the only simple way I’ve found was to create config parameters for the size of the layer and the number of layers.  
And then, in the training script, I transform it into the wanted RLLib form and pop the custom config from the config dictionary.  
Then, to do the hyperparameter tuning I use WanDB and create a sweep.  
Here are some code to make it more clear:

```
config['model'] = {
   "fcnet_activation": "tanh",
   "custom_model": "fc_masked_model",
    'fcnet_hiddens': [config['layer_size'] for k in range(config['layer_nb'])],
}
config = with_common_config(config)
config.pop('layer_size', None)
config.pop('layer_nb', None)

```

But, it’s not possible to do this with Tune as Tune runs directly the Policy 🤔
