BaseModelBuilder

class maze.perception.builders.base.BaseModelBuilder(modality_config: Dict[str, Union[str, Dict[str, Any]]], observation_modality_mapping: Dict[str, str])

Base class for perception default model builders.

Param

modality_config: dictionary mapping perception modalities to blocks and block config parameters.

Parameters

observation_modality_mapping – A mapping of observation keys to perception modalities.

abstract from_observation_space(observation_space: gym.spaces.Dict)maze.perception.blocks.inference.InferenceBlock

Compiles an inference graph for a given observation space.

Only observations which are contained in the self.observation_modalities dictionary are considered.

Parameters

observation_space – The respective observation space.

Returns

the resulting inference block.

classmethod to_recurrent_gym_space(observation_space: gym.spaces.Dict, rnn_steps: int) → gym.spaces.Dict

Converts the given observation space to a recurrent space.

Parameters
  • observation_space – The respective observation space.

  • rnn_steps – Number of recurrent time steps.

Returns

The rnn modified dictionary observation space.