online
online
¶
Online inference explanation source.
OnlineInferenceExplanationSource
¶
Adapts ready inference windows into explanation batches.
Initialize the online inference adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
consumer
|
ExplanationBatchConsumer
|
Object that generates explanations for each accepted inference window. |
required |
sample_stride
|
int
|
Explain every Nth inference timestep. |
1
|
max_samples
|
int | None
|
Optional cap on the number of ready inference windows sent to the consumer. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/versatil/explainability/sources/online.py
explain_observation_batch
¶
Generate explanations for one ready online inference batch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observation
|
ObservationBatch
|
The exact observation batch passed to
|
required |
display_observation
|
dict[str, Tensor]
|
Camera tensors for overlays. |
required |
environment_indices
|
list[int]
|
Environment indices represented by the batch rows. |
required |
timestep
|
int
|
Inference client timestep. |
required |