From a56f0e3dc171bfd02432847d90da4915de89cd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zhan=20=C3=96zen?= Date: Mon, 23 Jun 2025 17:32:21 +0200 Subject: [PATCH 1/4] Changes NoiseModelWithAdditiveBias to sample bias feature dimensions independently --- source/isaaclab/isaaclab/utils/noise/noise_model.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/isaaclab/isaaclab/utils/noise/noise_model.py b/source/isaaclab/isaaclab/utils/noise/noise_model.py index 6a6d4973237..e0c03b76300 100644 --- a/source/isaaclab/isaaclab/utils/noise/noise_model.py +++ b/source/isaaclab/isaaclab/utils/noise/noise_model.py @@ -154,6 +154,7 @@ def __init__(self, noise_model_cfg: noise_cfg.NoiseModelWithAdditiveBiasCfg, num # store the bias noise configuration self._bias_noise_cfg = noise_model_cfg.bias_noise_cfg self._bias = torch.zeros((num_envs, 1), device=self._device) + self._feature_dim: int | None = None def reset(self, env_ids: Sequence[int] | None = None): """Reset the noise model. @@ -179,4 +180,11 @@ def apply(self, data: torch.Tensor) -> torch.Tensor: Returns: The data with the noise applied. Shape is the same as the input data. """ + # on first apply, expand bias to match last dim of data + if self._feature_dim is None: + *_, self._feature_dim = data.shape + # expand bias from (num_envs,1) to (num_envs, feature_dim) + self._bias = self._bias.repeat(1, self._feature_dim) + # now re-sample that expanded bias in-place + self.reset() return super().apply(data) + self._bias From f19027aff8f4fc9af8bfafba13600bbc56be8eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zhan=20=C3=96zen?= Date: Mon, 23 Jun 2025 17:33:29 +0200 Subject: [PATCH 2/4] Updates changelog --- source/isaaclab/config/extension.toml | 2 +- source/isaaclab/docs/CHANGELOG.rst | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/isaaclab/config/extension.toml b/source/isaaclab/config/extension.toml index aa5e112813c..17c1d542be7 100644 --- a/source/isaaclab/config/extension.toml +++ b/source/isaaclab/config/extension.toml @@ -1,7 +1,7 @@ [package] # Note: Semantic Versioning is used: https://semver.org/ -version = "0.40.6" +version = "0.40.X" # Description title = "Isaac Lab framework for Robot Learning" diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index aa1cb1bc068..ffbcb30100e 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -1,6 +1,16 @@ Changelog --------- +## [Unreleased] +~~~~~~~~~~~~~~~ + +Changed +^^^^^^^ + +* Changed :class:`~isaaclab.utils.noise.noise_model.NoiseModelWithAdditiveBias` to sample each bias feature dimension independently. + Previously, for multi-dimensional data, e.g., a 3D position vector, all feature dimensions shared the same bias value. + + 0.40.6 (2025-06-12) ~~~~~~~~~~~~~~~~~~~ From 66b635999bd2b7f14ff90527c8fc0a602296ecac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zhan=20=C3=96zen?= Date: Wed, 25 Jun 2025 23:34:46 +0200 Subject: [PATCH 3/4] Adds sample_bias_per_component flag --- source/isaaclab/isaaclab/utils/noise/noise_cfg.py | 6 ++++++ source/isaaclab/isaaclab/utils/noise/noise_model.py | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/isaaclab/isaaclab/utils/noise/noise_cfg.py b/source/isaaclab/isaaclab/utils/noise/noise_cfg.py index 508dff69654..0c49828b3ff 100644 --- a/source/isaaclab/isaaclab/utils/noise/noise_cfg.py +++ b/source/isaaclab/isaaclab/utils/noise/noise_cfg.py @@ -103,3 +103,9 @@ class NoiseModelWithAdditiveBiasCfg(NoiseModelCfg): Based on this configuration, the bias is sampled at every reset of the noise model. """ + + sample_bias_per_component: bool = True + """Whether to sample a separate bias for each data component. + + Defaults to True. + """ diff --git a/source/isaaclab/isaaclab/utils/noise/noise_model.py b/source/isaaclab/isaaclab/utils/noise/noise_model.py index d3ebfeaa71c..dae36b55c72 100644 --- a/source/isaaclab/isaaclab/utils/noise/noise_model.py +++ b/source/isaaclab/isaaclab/utils/noise/noise_model.py @@ -154,7 +154,8 @@ def __init__(self, noise_model_cfg: noise_cfg.NoiseModelWithAdditiveBiasCfg, num # store the bias noise configuration self._bias_noise_cfg = noise_model_cfg.bias_noise_cfg self._bias = torch.zeros((num_envs, 1), device=self._device) - self._feature_dim: int | None = None + self._num_components: int | None = None + self._sample_bias_per_component = noise_model_cfg.sample_bias_per_component def reset(self, env_ids: Sequence[int] | None = None): """Reset the noise model. @@ -180,11 +181,11 @@ def __call__(self, data: torch.Tensor) -> torch.Tensor: Returns: The data with the noise applied. Shape is the same as the input data. """ - # on first apply, expand bias to match last dim of data - if self._feature_dim is None: - *_, self._feature_dim = data.shape - # expand bias from (num_envs,1) to (num_envs, feature_dim) - self._bias = self._bias.repeat(1, self._feature_dim) + # if sample_bias_per_component, on first apply, expand bias to match last dim of data + if self._sample_bias_per_component and self._num_components is None: + *_, self._num_components = data.shape + # expand bias from (num_envs,1) to (num_envs, num_components) + self._bias = self._bias.repeat(1, self._num_components) # now re-sample that expanded bias in-place self.reset() return super().__call__(data) + self._bias From 757e42bc9432ef1f269aea2f0a255ca19b4c6df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zhan=20=C3=96zen?= Date: Wed, 25 Jun 2025 23:34:59 +0200 Subject: [PATCH 4/4] Updates changelog --- source/isaaclab/config/extension.toml | 2 +- source/isaaclab/docs/CHANGELOG.rst | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/isaaclab/config/extension.toml b/source/isaaclab/config/extension.toml index 17c1d542be7..82a900e5540 100644 --- a/source/isaaclab/config/extension.toml +++ b/source/isaaclab/config/extension.toml @@ -1,7 +1,7 @@ [package] # Note: Semantic Versioning is used: https://semver.org/ -version = "0.40.X" +version = "0.40.9" # Description title = "Isaac Lab framework for Robot Learning" diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index a1eeea5ef42..12778b61d38 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -1,14 +1,14 @@ Changelog --------- -## [Unreleased] -~~~~~~~~~~~~~~~ +0.40.9 (2025-06-25) +~~~~~~~~~~~~~~~~~~~ -Changed -^^^^^^^ +Added +^^^^^ -* Changed :class:`~isaaclab.utils.noise.noise_model.NoiseModelWithAdditiveBias` to sample each bias feature dimension independently. - Previously, for multi-dimensional data, e.g., a 3D position vector, all feature dimensions shared the same bias value. +* Added ``sample_bias_per_component`` flag to :class:`~isaaclab.utils.noise.noise_model.NoiseModelWithAdditiveBias` to enable independent per-component bias + sampling, which is now the default behavior. If set to False, the previous behavior of sharing the same bias value across all components is retained. 0.40.8 (2025-06-18)