action_postprocessor
action_postprocessor
¶
Action postprocessing for the inference pipeline.
ActionPostprocessor
¶
Converts raw policy output tensors into structured action dicts for the server.
Handles gripper postprocessing (sigmoid for binary), denoising thresholds, and action metadata construction from the action space.
Initialize the action postprocessor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_space
|
ActionSpace
|
Policy's action space with metadata per key. |
required |
denoising_thresholds
|
dict[str, float]
|
Per-VersatIL-key denoising thresholds. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If two predicted action keys share an action type; the wire format is keyed by ActionComponent and cannot express duplicates. |
Source code in src/versatil/inference/action_postprocessor.py
format_action
¶
Format action tensors into a structured dict keyed by ActionComponent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action_dict
|
dict[str, Tensor]
|
Dict mapping VersatIL action key to tensor. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, list[float]]
|
Dict mapping ActionComponent value to action values list. |
Source code in src/versatil/inference/action_postprocessor.py
build_action_metadata
¶
Build action metadata dict keyed by ActionComponent.
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, str | int]]
|
Dict mapping ActionComponent value to metadata entry. |