From 5dabb5d0ba596539901ca7521402618a3b595e5f Mon Sep 17 00:00:00 2001 From: nunzip Date: Wed, 13 Mar 2019 22:33:36 +0000 Subject: Revert "Normalize labels" This reverts commit e33168c1471e651527e6d4ae15faaebbcf6fa5d9. --- ncdcgan.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ncdcgan.py b/ncdcgan.py index ce6b907..ccb99d3 100755 --- a/ncdcgan.py +++ b/ncdcgan.py @@ -157,7 +157,6 @@ class nCDCGAN(): X_train = (X_train.astype(np.float32) - 127.5) / 127.5 X_train = np.expand_dims(X_train, axis=3) y_train = y_train.reshape(-1, 1) - y_train = (y_train.astype(np.float32)-4.5)/4.5 # Adversarial ground truths valid = np.ones((batch_size, 1)) @@ -215,7 +214,6 @@ class nCDCGAN(): r, c = 2, 5 noise = np.random.normal(0, 1, (r * c, 100)) sampled_labels = np.arange(0, 10).reshape(-1, 1) - sampled_labels = (sampled_labels.astype(np.float32)-4.5)/4.5 #using dummy_labels would just print zeros to help identify image quality #dummy_labels = np.zeros(32).reshape(-1, 1) @@ -241,7 +239,6 @@ class nCDCGAN(): noise_test = np.random.normal(0, 1, (10000, 100)) noise_val = np.random.normal(0, 1, (5000, 100)) - ((labels_val.astype(np.float32)-4.5)/4.5) labels_train = np.zeros(55000).reshape(-1, 1) labels_test = np.zeros(10000).reshape(-1, 1) labels_val = np.zeros(5000).reshape(-1, 1) @@ -251,9 +248,9 @@ class nCDCGAN(): labels_test[i*1000:-1] = i labels_val[i*500:-1] = i - train_data = self.generator.predict([noise_train, ((labels_train.astype(np.float32)-4.5)/4.5)]) - test_data = self.generator.predict([noise_test, ((labels_test.astype(np.float32)-4.5)/4.5)]) - val_data = self.generator.predict([noise_val,((labels_val.astype(np.float32)-4.5)/4.5)]) + train_data = self.generator.predict([noise_train, labels_train]) + test_data = self.generator.predict([noise_test, labels_test]) + val_data = self.generator.predict([noise_val, labels_val]) labels_train = keras.utils.to_categorical(labels_train, 10) labels_test = keras.utils.to_categorical(labels_test, 10) -- cgit v1.2.3-54-g00ecf