From 3c062c1accb135333a56be2f29d4cdf128caed01 Mon Sep 17 00:00:00 2001 From: Zihan Gao Date: Thu, 16 Jul 2026 20:45:45 +0800 Subject: [PATCH] fix normalization --- wall_x/model/core/action/normalizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wall_x/model/core/action/normalizer.py b/wall_x/model/core/action/normalizer.py index 5c1a7d8..20af594 100644 --- a/wall_x/model/core/action/normalizer.py +++ b/wall_x/model/core/action/normalizer.py @@ -285,9 +285,9 @@ def normalize_data(self, xs, dataset_names): new_xs = [] dataset_names = [name for name in dataset_names if name != "x2_multimodal"] for x, dataset_name in zip(xs, dataset_names): - # if dataset_name == "ex_normal": - # dataset_name = "x2_normal" - x = (x - self.min[dataset_name]) / (self.delta[dataset_name]) + delta = self.delta[dataset_name] + delta = torch.where(delta == 0, torch.ones_like(delta), delta) + x = (x - self.min[dataset_name]) / delta x = x * 2 - 1 x = torch.clamp(x, -1, 1) new_xs.append(x)