observation_spec()

This method is similar to env.observation_space(), which we used with the Gym environments. This method returns a list specifying all the available observations supported by the DM Lab environment. It also includes specifications about level-dependent custom observations.

The specifications contain the name, type, and shape of the tensor or string that will be returned if that specification name is specified in the observation list (such as the 'RGBD' example previously). For example, the following code snippet lists two items in the list that will be returned to give you an idea about what the specs contain:

{    'dtype': <type'numpy.uint8'>, ## Array data type'name': 'RGBD',                ## Name of observation.'shape': (4, 180, 320 ...

Get Hands-On Intelligent Agents with OpenAI Gym now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.