aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-14 01:32:52 +0000
committernunzip <np.scarh@gmail.com>2019-03-14 01:32:52 +0000
commit2273313e2d818ab26f1c7a0c6bb89d5728611ad7 (patch)
tree87964acd0d562c2d1f9462c6d5fe271dabe4baf2
parent5dabb5d0ba596539901ca7521402618a3b595e5f (diff)
downloade4-gan-2273313e2d818ab26f1c7a0c6bb89d5728611ad7.tar.gz
e4-gan-2273313e2d818ab26f1c7a0c6bb89d5728611ad7.tar.bz2
e4-gan-2273313e2d818ab26f1c7a0c6bb89d5728611ad7.zip
Set output size
-rwxr-xr-xncdcgan.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/ncdcgan.py b/ncdcgan.py
index ccb99d3..97b137b 100755
--- a/ncdcgan.py
+++ b/ncdcgan.py
@@ -234,19 +234,21 @@ class nCDCGAN():
fig.savefig("images/%d.png" % epoch)
plt.close()
- def generate_data(self):
- noise_train = np.random.normal(0, 1, (55000, 100))
- noise_test = np.random.normal(0, 1, (10000, 100))
- noise_val = np.random.normal(0, 1, (5000, 100))
+ def generate_data(self, out=55000):
+ v_out = int(out/11)
+ te_out = v_out*2
+ noise_train = np.random.normal(0, 1, (out, 100))
+ noise_test = np.random.normal(0, 1, (te_out, 100))
+ noise_val = np.random.normal(0, 1, (v_out, 100))
- labels_train = np.zeros(55000).reshape(-1, 1)
- labels_test = np.zeros(10000).reshape(-1, 1)
- labels_val = np.zeros(5000).reshape(-1, 1)
+ labels_train = np.zeros(out).reshape(-1, 1)
+ labels_test = np.zeros(te_out).reshape(-1, 1)
+ labels_val = np.zeros(v_out).reshape(-1, 1)
for i in range(10):
- labels_train[i*5500:-1] = i
- labels_test[i*1000:-1] = i
- labels_val[i*500:-1] = i
+ labels_train[i*int(out/10):-1] = i
+ labels_test[i*int(te_out/10):-1] = i
+ labels_val[i*int(v_out/10):-1] = i
train_data = self.generator.predict([noise_train, labels_train])
test_data = self.generator.predict([noise_test, labels_test])