typedefs
typedefs
¶
Shared explainability type aliases.
VisionExplainableModule
dataclass
¶
Camera-addressable visual module exposed to the explainer.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Stable module path used by runner filters and output metadata. |
module |
Module
|
Module that owns |
target |
VisionExplanationTarget
|
Target layer metadata used to capture activations and reshape feature maps. |
camera_keys |
tuple[str, ...]
|
Observation camera keys that can be attributed through this module. |
capture_mode |
str
|
Hook routing mode from |
CameraExplanationTarget
dataclass
¶
CameraExplanationTarget(camera_key, vision_module_name, target, capture_mode, invocation_index=None, stacked_camera_index=None, stacked_camera_count=None)
Concrete visual target for one output camera heatmap.
Attributes:
| Name | Type | Description |
|---|---|---|
camera_key |
str
|
Observation camera key whose overlay should be generated. |
vision_module_name |
str
|
Name of the module that produced the target activation. |
target |
VisionExplanationTarget
|
Target layer metadata used by Grad-CAM and Ablation-CAM. |
capture_mode |
str
|
Hook routing mode from |
invocation_index |
int | None
|
Selected forward-hook call for modules invoked once
per camera. |
stacked_camera_index |
int | None
|
Camera index inside a stacked camera batch when
|
stacked_camera_count |
int | None
|
Number of cameras inside the stacked batch. |
ExplanationHeatmapFunction
¶
Bases: Protocol
Callable contract used by the explanation method registry.
__call__
¶
__call__(policy, observation, actions, target_camera, target_vision_module_names, preprocess_observation)
Compute heatmaps for one explanation method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
Policy
|
Policy whose prediction is being explained. |
required |
observation
|
ObservationBatch
|
Observation tensors keyed by observation-space names. |
required |
actions
|
ActionBatch | None
|
Optional action tensors used by discrete predictors to score teacher-forced action-token likelihoods. |
required |
target_camera
|
str | None
|
Optional camera key selected by runner filtering. |
required |
target_vision_module_names
|
list[str] | None
|
Optional visual module allowlist. |
required |
preprocess_observation
|
bool
|
Whether to run policy preprocessing before attribution. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Tensor]
|
Heatmaps keyed by camera name. |