torchrl.trainers.algorithms.configs.modules.ConvNetConfig¶
- class torchrl.trainers.algorithms.configs.modules.ConvNetConfig(_partial_: bool = False, in_features: int | None = None, depth: int | None = None, num_cells: Any = None, kernel_sizes: Any = 3, strides: Any = 1, paddings: Any = 0, activation_class: ActivationConfig = <factory>, activation_kwargs: Any = None, norm_class: NormConfig | None = None, norm_kwargs: Any = None, bias_last_layer: bool = True, aggregator_class: AggregatorConfig = <factory>, aggregator_kwargs: dict | None = None, squeeze_output: bool = False, device: Any = None, _target_: str = 'torchrl.modules.ConvNet')[source]¶
A class to configure a convolutional network.
Defaults to
torchrl.modules.ConvNet
.Example
>>> cfg = ConvNetConfig(in_features=3, depth=2, num_cells=[32, 64], kernel_sizes=[3, 5], strides=[1, 2], paddings=[1, 2]) >>> net = instantiate(cfg) >>> y = net(torch.randn(1, 3, 32, 32)) >>> assert y.shape == (1, 64)
See also