Skip to content

Commit

Permalink
Recreate MNIST data as it was during experiment time.
Browse files Browse the repository at this point in the history
  • Loading branch information
tibuch committed Apr 1, 2021
1 parent 2515356 commit 536ea3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fit/datamodules/tomo_rec/TRecDataModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ def prepare_data(self, *args, **kwargs):
assert mnist_train.shape[1] == self.gt_shape
assert mnist_train.shape[2] == self.gt_shape

mnist_train = np.clip(mnist_train, 50, 255)
mnist_val = np.clip(mnist_val, 50, 255)
mnist_test = np.clip(mnist_test, 50, 255)
circle = self.__get_circle__()
mnist_train = circle * np.clip(mnist_train, 50, 255)
mnist_val = circle * np.clip(mnist_val, 50, 255)
mnist_test = circle * np.clip(mnist_test, 50, 255)

self.mean = mnist_train.mean()
self.std = mnist_train.std()
Expand All @@ -116,7 +117,6 @@ def prepare_data(self, *args, **kwargs):
mnist_val = normalize(mnist_val, self.mean, self.std)
mnist_test = normalize(mnist_test, self.mean, self.std)

circle = self.__get_circle__()
mnist_train *= circle
mnist_val *= circle
mnist_test *= circle
Expand Down

0 comments on commit 536ea3b

Please sign in to comment.