PerceptionBlock

class maze.perception.blocks.base.PerceptionBlock(*args: Any, **kwargs: Any)

Interface for all perception blocks. Perception blocks provide a mapping of M input tensors to N output tensors. Both input and output tensors are stored in a dictionary with unique keys.

Parameters
  • in_keys – Keys identifying the input tensors.

  • out_keys – Keys identifying the output tensors.

  • in_shapes – List of input shapes.

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

Forward pass of perception block.

Parameters

block_input – The block’s input dictionary.

Returns

The block’s output dictionary.

get_num_of_parameters()int

Calculates the total number of parameters in the model :return: The total number of parameters

out_shapes() → List[Sequence[int]]

Returns the perception block’s output shape.

Returns

a list of output shapes.