ObsEncoder¶
- class torchrl.modules.ObsEncoder(channels=32, num_layers=4, depth=None)[source]¶
Observation encoder network.
Takes a pixel observation and encodes it into a latent space.
Reference: https://arxiv.org/abs/1803.10122
- Parameters:
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.
- forward(observation)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.