ray.rllib.core.models.catalog.Catalog.build_encoder#

Catalog.build_encoder(framework: str) Encoder[source]#

Builds the encoder.

By default, this method builds an encoder instance from Catalog._encoder_config.

You should override this if you want to use RLlib’s default RL Modules but only want to change the encoder. For example, if you want to use a custom encoder, but want to use RLlib’s default heads, action distribution and how tensors are routed between them. If you want to have full control over the RL Module, we recommend writing your own RL Module by inheriting from one of RLlib’s RL Modules instead.

Parameters:

framework – The framework to use. Either “torch” or “tf2”.

Returns:

The encoder.