- class torchrl.modules.ObsEncoder(channels=32, num_layers=4, depth=None)¶
Observation encoder network.
Takes an pixel observation and encodes it into a latent space.
channels (int, optional) – Number of hidden units in the first layer. Defaults to 32.
num_layers (int, optional) – Depth of the network. Defaults to 4.
Defines the computation performed at every call.
Should be overridden by all subclasses.
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.