From 01dc289f3d0b9bb5765becb5c8b976f866b87835 Mon Sep 17 00:00:00 2001 From: Adil Zouitine Date: Fri, 4 Jul 2025 12:55:35 +0200 Subject: [PATCH] chore (docstrin):Improve docstring for NormalizerProcessor --- src/lerobot/processor/normalize_processor.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lerobot/processor/normalize_processor.py b/src/lerobot/processor/normalize_processor.py index 808384ccb..6b3cae5be 100644 --- a/src/lerobot/processor/normalize_processor.py +++ b/src/lerobot/processor/normalize_processor.py @@ -32,14 +32,17 @@ def _convert_stats_to_tensors(stats: dict[str, dict[str, Any]]) -> dict[str, dic @dataclass @ProcessorStepRegistry.register(name="normalizer_processor") class NormalizerProcessor: - """Normalize observations *and* actions in one go. + """Normalizes observations and actions in a single processor step. - This is a thin convenience wrapper equivalent to:: + This processor handles normalization of both observation and action tensors + using either mean/std normalization or min/max scaling to a [-1, 1] range. - proc = RobotProcessor([ObservationNormalizer(stats, ...), ActionNormalizer(action_stats, ...)]) + For each tensor key in the stats dictionary, the processor will: + - Use mean/std normalization if those statistics are provided: (x - mean) / std + - Use min/max scaling if those statistics are provided: 2 * (x - min) / (max - min) - 1 - Keeping it as a single step is handy for profiling and simplifies - configuration files. + The processor can be configured to normalize only specific keys by setting + the normalize_keys parameter. """ stats: dict[str, dict[str, Any]]