Skip to content

Commit

Permalink
Severe Bug Fixed: MNIST and USPS has different scales (0-1) vs (0-255…
Browse files Browse the repository at this point in the history
…) in dataloader
  • Loading branch information
yuhui-zh15 committed Apr 12, 2022
1 parent 3d38435 commit 13a295a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datasets/usps.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self, root, train=True, transform=None, download=False):
np.random.shuffle(indices)
self.train_data = self.train_data[indices[0:self.dataset_size], ::]
self.train_labels = self.train_labels[indices[0:self.dataset_size]]
self.train_data *= 255.0

self.train_data = self.train_data.transpose(
(0, 2, 3, 1)) # convert to HWC

Expand Down

0 comments on commit 13a295a

Please sign in to comment.