aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-13 22:33:36 +0000
committernunzip <np.scarh@gmail.com>2019-03-13 22:33:36 +0000
commit5dabb5d0ba596539901ca7521402618a3b595e5f (patch)
tree1ab29926ff552016f48bcaf98fa9e77a58aaa602
parente33168c1471e651527e6d4ae15faaebbcf6fa5d9 (diff)
downloade4-gan-5dabb5d0ba596539901ca7521402618a3b595e5f.tar.gz
e4-gan-5dabb5d0ba596539901ca7521402618a3b595e5f.tar.bz2
e4-gan-5dabb5d0ba596539901ca7521402618a3b595e5f.zip
Revert "Normalize labels"
This reverts commit e33168c1471e651527e6d4ae15faaebbcf6fa5d9.
-rwxr-xr-xncdcgan.py9
1 files 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)