openrl icon indicating copy to clipboard operation
openrl copied to clipboard

How to set the parameter to customize the number of hidden layers and their hidden sizes

Open astonisingHSR opened this issue 2 years ago • 2 comments

❓ Question

Setting the config parameter seems to only make all the hidden layers the same size. How can I set the parameter to customize the number of hidden layers and their respective sizes? For examples, if i want to set up a policy network with three hidden layers, each of size 128, 64, 32. How do I set or modify the config parameter. I would appreciate it if you could give me a detailed reply.

Checklist

  • [X] I have checked that there is no similar issues in the repo
  • [X] I have read the documentation

astonisingHSR avatar Sep 20 '23 07:09 astonisingHSR

You can pass your predefined neural network to the OpenRL: image

Code Examples1: https://github.com/OpenRL-Lab/openrl/blob/8797b0999b0bacdac0658eda54c137f0c06e4544/examples/sb3/train_ppo.py#L37 Code Example2: https://github.com/OpenRL-Lab/openrl/blob/8797b0999b0bacdac0658eda54c137f0c06e4544/examples/nlp/train_ppo.py#L25 Document: https://openrl-docs.readthedocs.io/en/latest/quick_start/train_nlp.html

huangshiyu13 avatar Sep 20 '23 10:09 huangshiyu13

Thank you for your careful response!

astonisingHSR avatar Sep 21 '23 14:09 astonisingHSR