Skip to content

allenact.embodiedai.mapping.mapping_losses#

[view_source]

BinnedPointCloudMapLoss#

class BinnedPointCloudMapLoss(AbstractActorCriticLoss)

[view_source]

A (binary cross entropy) loss for training metric maps for free space prediction.

BinnedPointCloudMapLoss.__init__#

 | __init__(binned_pc_uuid: str, map_logits_uuid: str)

[view_source]

Initializer.

Parameters

  • binned_pc_uuid : The uuid of a sensor returning a dictionary with an "egocentric_update" key with the same format as returned by allenact.embodied_ai.mapping_utils.map_builders.BinnedPointCloudMapBuilder. Such a sensor
  • can be found in the allenact_plugins library: see allenact_plugins.ithor_plugin.ithor_sensors.BinnedPointCloudMapTHORSensor.
  • map_logits_uuid : key used to index into actor_critic_output.extras (returned by the model) whose value should be a tensor of the same shape as the tensor corresponding to the above "egocentric_update" key.

SemanticMapFocalLoss#

class SemanticMapFocalLoss(AbstractActorCriticLoss)

[view_source]

A (focal-loss based) loss for training metric maps for free space prediction.

As semantic maps tend to be quite sparse this loss uses the focal loss (https://arxiv.org/abs/1708.02002) rather than binary cross entropy (BCE). If the gamma parameter is 0.0 then this is just the normal BCE, larger values of gamma result less and less emphasis being paid to examples that are already well classified.

SemanticMapFocalLoss.__init__#

 | __init__(semantic_map_uuid: str, map_logits_uuid: str, gamma: float = 2.0)

[view_source]

Initializer.

Parameters

  • semantic_map_uuid : The uuid of a sensor returning a dictionary with an "egocentric_update" key with the same format as returned by allenact.embodied_ai.mapping_utils.map_builders.SemanticMapBuilder. Such a sensor
  • can be found in the allenact_plugins library: see allenact_plugins.ithor_plugin.ithor_sensors.SemanticMapTHORSensor.
  • map_logits_uuid : key used to index into actor_critic_output.extras (returned by the model) whose value should be a tensor of the same shape as the tensor corresponding to the above "egocentric_update" key.