runner
runner
¶
Hydra-instantiated runner for policy explainability workflows.
ExplainabilityRunner
¶
ExplainabilityRunner(checkpoint_path, checkpoint_name=value, output_directory=None, device='auto', source=value, split='all', sample_stride=50, max_samples=None, data_path_override=None, batch_size=1, channel_batch_size=32, explanation_types=None, target_camera_keys=None, target_vision_module_names=None, online=None, writer=None)
Generate xAI insights for the predictions of a trained policy.
Initialize the runner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint_path
|
str
|
Directory containing the training |
required |
checkpoint_name
|
str
|
Checkpoint filename to restore trained policy. |
value
|
output_directory
|
str | None
|
Directory for written explanation files. |
None
|
device
|
str
|
Device name, or |
'auto'
|
source
|
str
|
Explanation source type. Standalone |
value
|
split
|
str
|
Dataset split for offline explanations. |
'all'
|
sample_stride
|
int
|
Explanation interval. In offline dataset mode, keep every Nth episodic dataset sample. In online inference mode, explain every Nth inference timestep. |
50
|
max_samples
|
int | None
|
Optional cap on the number of observation windows to
explain. Offline mode applies this after |
None
|
data_path_override
|
str | list[str] | None
|
Optional offline input location to explain
instead of the data path stored in the checkpoint task config.
|
None
|
batch_size
|
int
|
Number of samples per attribution call. |
1
|
channel_batch_size
|
int
|
Number of channels per Ablation-CAM forward. |
32
|
explanation_types
|
list[str] | None
|
Explanation methods to run. If None, it runs all supported methods. |
None
|
target_camera_keys
|
list[str] | None
|
Optional camera-key allowlist for generated heatmaps. |
None
|
target_vision_module_names
|
list[str] | None
|
Optional visual module allowlist. Names include encoding-pipeline entries and decoder-owned VLM vision tower paths. |
None
|
online
|
InferenceClientConfig | None
|
Socket inference client settings used by
|
None
|
writer
|
ExplanationWriterConfig | None
|
Explanation writer settings controlling raw heatmaps,
overlays, blending, and image format. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If explanation types or source data are invalid. |
Source code in src/versatil/explainability/runner.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
run
¶
Run the configured explainability workflow.
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/versatil/explainability/runner.py
build_online_source
¶
Build an online inference adapter for InferenceClient.
Returns:
| Type | Description |
|---|---|
OnlineInferenceExplanationSource
|
Online source that delegates accepted inference windows to this |
OnlineInferenceExplanationSource
|
runner. |
Source code in src/versatil/explainability/runner.py
explain_batch
¶
Generate configured explanations for one batch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
batch
|
ExplanationBatch
|
Observation window and metadata from a supported source. |
required |