Elegant way to replace SACTorchModel

Hi all,

I need to apply some custom changes to the SACTorchModel. As indicated in the docstring of this class, one way to do it is to subclass it and do the changes.

The question is, where in the policy/trainer’s config do I indicate that this modified model should be used?

Thanks!

Hi @bmanczak

Check out the code snippet just before this section of the docs.

https://docs.ray.io/en/latest/rllib-models.html#implementing-custom-recurrent-networks


1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Hey @bmanczak , what @mannyv said! :slight_smile:
Plus, for those algos that must use special model APIs, like SAC (or DQN), you should simply sub-class the given SAC[Torch|Tf]Model and plug your new sub-class into the config like so:

config:
  model:
    custom_model: [your sub-class]
    custom_model_config: {
      c'tor kwargs for your new class
    }
1 Like