habitat.core.embodied_task

Implements tasks and measurements needed for training and benchmarking of habitat.Agent inside habitat.Env.

class habitat.core.embodied_task.EmbodiedTask(config: yacs.config.CfgNode, sim: habitat.core.simulator.Simulator, dataset: Optional[habitat.core.dataset.Dataset] = None)[source]

Base class for embodied tasks. When subclassing the user has to define the attributes measurements and sensor_suite.

Parameters
  • config – config for the task.

  • sim – reference to the simulator for calculating task observations.

  • dataset – reference to dataset for task instance level information.

measurements

set of task measures.

sensor_suite

suite of task sensors.

overwrite_sim_config(sim_config: yacs.config.CfgNode, episode: Type[habitat.core.dataset.Episode]) → yacs.config.CfgNode[source]
Parameters
  • sim_config – config for simulator.

  • episode – current episode.

Returns

update config merging information from sim_config and

episode.

class habitat.core.embodied_task.Measure(*args, **kwargs)[source]

Represents a measure that provides measurement on top of environment and task. This can be used for tracking statistics when running experiments. The user of this class needs to implement the reset_metric and update_metric method and the user is also required to set the below attributes:

uuid

universally unique id.

_metric

metric for the Measure, this has to be updated with each step call on habitat.Env.

get_metric()[source]
Returns

the current metric for Measure.

reset_metric(*args, **kwargs) → None[source]

Reset _metric, this method is called from Env on each reset.

update_metric(*args, **kwargs) → None[source]

Update _metric, this method is called from Env on each step.

class habitat.core.embodied_task.Measurements(measures: List[habitat.core.embodied_task.Measure])[source]

Represents a set of Measures, with each Measure being identified through a unique id.

Parameters

measures – list containing Measure, uuid of each Measure must be unique.

get_metrics() → habitat.core.embodied_task.Metrics[source]
Returns

collect measurement from all Measures and return it packaged inside Metrics.

class habitat.core.embodied_task.Metrics(measures: Dict[str, habitat.core.embodied_task.Measure])[source]

Dictionary containing measurements.

Parameters

measures – list of Measure whose metrics are fetched and packaged.