transform_builder
transform_builder
¶
TransformBuilder
¶
TransformBuilder(replay_buffer, action_processor, prediction_horizon, observation_space, episode_ends, kinematics_norm_type, image_norm_type, depth_norm_type, depth_winsorize_quantiles=(0.01, 0.99), kinematics_winsorize_quantiles=(0.01, 0.99), tokenization_config=None, clamp_kinematics_range=True, min_kinematics_std=0.02, min_kinematics_range=0.04, action_sample_size=2048, episode_selection_mask=None, seed=42)
Builder for creating and configuring data normalizers and tokenizers.
Initialize transform builder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
replay_buffer
|
ReplayBuffer
|
Data source |
required |
action_processor
|
ActionProcessor
|
For computing actions and applying denoising |
required |
prediction_horizon
|
int
|
Prediction horizon for action chunking. |
required |
observation_space
|
ObservationSpace
|
The observation space configuration |
required |
episode_ends
|
ndarray
|
Episode boundaries |
required |
kinematics_norm_type
|
str
|
Normalization type for kinematics |
required |
image_norm_type
|
str
|
Normalization type for RGB images |
required |
depth_norm_type
|
str
|
Normalization type for depth images |
required |
depth_winsorize_quantiles
|
tuple[float, float] | None
|
Quantiles for depth winsorization (lower, upper). |
(0.01, 0.99)
|
kinematics_winsorize_quantiles
|
tuple[float, float] | None
|
Quantiles for kinematics winsorization. |
(0.01, 0.99)
|
tokenization_config
|
TokenizationConfig | None
|
Tokenization configuration. If None, no tokenizer created. |
None
|
clamp_kinematics_range
|
bool
|
Whether to clamp std/range to minimum values. |
True
|
min_kinematics_std
|
float
|
Minimum std for Gaussian mode when clamp_kinematics_range=True. |
0.02
|
min_kinematics_range
|
float
|
Minimum range for MinMax mode when clamp_kinematics_range=True. |
0.04
|
action_sample_size
|
int
|
Number of action chunk windows (length
|
2048
|
episode_selection_mask
|
ndarray | None
|
Optional boolean mask over episodes. Statistics, tokenizers, and denoising thresholds are fitted only on selected episodes (the training split), keeping validation data out of the fitted transforms. |
None
|
seed
|
int
|
Seed for the subsampling used by depth-quantile estimation, so fitted statistics are reproducible. |
42
|
Source code in src/versatil/data/processing/transform_builder.py
create_normalizer_and_tokenizer
¶
Create and fit normalizer and optionally tokenizer to data. Pipeline: Raw data → Winsorize → Normalize → Tokenize
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
device | None
|
Target device for tensors |
None
|
Returns:
| Type | Description |
|---|---|
tuple[LinearNormalizer, Tokenizer | None]
|
Tuple of (normalizer, tokenizer) where tokenizer is None if not configured |
Source code in src/versatil/data/processing/transform_builder.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
compute_proprioceptive_denoising_thresholds
¶
Compute denoising thresholds for proprioceptive observations.