class maze.perception.blocks.feed_forward.dense.DenseBlock(*args: Any, **kwargs: Any)

A block containing multiple subsequent dense layers. The block expects the input tensors to have the from (batch-dim, feature-dim).

  • in_keys – One key identifying the input tensors.

  • out_keys – One key identifying the output tensors.

  • in_shapes – List of input shapes.

  • hidden_units – List containing the number of hidden units for hidden layers.

  • non_lin – The non-linearity to apply after each layer.


Compiles a block-specific dictionary of network layers. This could be overwritten by derived layers (e.g. to get a ‘BatchNormalizedDenseBlock’).


Ordered dictionary of torch modules [str, nn.Module]

normalized_forward(block_input: Dict[str, torch.Tensor]) → Dict[str, torch.Tensor]

(overrides ShapeNormalizationBlock)

implementation of ShapeNormalizationBlock interface