Skip to content

Commit

Permalink
Fixed MinMax normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Brune committed Oct 28, 2024
1 parent 3fdd72b commit 4f318f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pangaea/engine/data_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,8 @@ def __call__(
"""

for k in self.data_min.keys():
size = (-1,) + data["image"][k].shape[1:]
data["image"][k].sub_(self.data_min[k].view(size)).div_(
(self.data_max[k] - self.data_min[k]).view(size)
data["image"][k].sub_(self.data_min[k].view(-1, 1, 1, 1)).div_(
(self.data_max[k] - self.data_min[k]).view(-1, 1, 1, 1)
)
return data

Expand Down

0 comments on commit 4f318f9

Please sign in to comment.