Skip to content

Commit

Permalink
Merge pull request #89 from KarhouTam/dev
Browse files Browse the repository at this point in the history
fix(data): Make normalization works correctly (#88)
  • Loading branch information
KarhouTam authored Sep 15, 2024
2 parents 21e6a33 + 7d24cb0 commit bff79ed
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions data/utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ def __init__(

def _rescale_data(self):
max_val = self.data.max()
min_val = self.data.min()
if max_val > 1.0 or min_val < 0.0:
self.data = (self.data - min_val) / (max_val - min_val)
if max_val > 1.0:
self.data /= 255.0

def __getitem__(self, index):
data, targets = self.data[index], self.targets[index]
Expand Down

0 comments on commit bff79ed

Please sign in to comment.