[rllib] different networks for different policies

Hello there !
I know how to plug a custom net for a policy like this :
“model”: {
“custom_model”: “torch_net”
}
But I don’t know how to specify different networks for different policies when there are more than one policy and only one training method (A2C for example). I didn’t find anything in the doc, and I didn’t find anything in the examples on github.
Thanks for your help !

Hey @Jogima-cyber
you can specify per-policy config overrides via your multi-agent setup. Like so:


# You multi-agent policy dict:
policies = {
    "pol1": ([class], [obs-space], [action-space], {"model": {"fcnet_hiddens": [50, 50]}}),  # <- will use default fc net
    "pol2": ([class], [obs-space], [action-space], {"model": {"custom_model": "torch_net"}}),  # <- will use your custom torch model
}

Then your config:

config:
    multiagent: 
        policies: policies   # <- dict from above
1 Like