aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornunzip <np.scarh@gmail.com>2019-03-07 21:36:32 +0000
committernunzip <np.scarh@gmail.com>2019-03-07 21:36:32 +0000
commit4a534691c7b5875ce7ab50d69e517af7a9db14ce (patch)
tree0f00adbb2b886731dab7cba78f175989f5718e18
parent4d53cc2ae5fa3340d46bc5840fb287ecf8594297 (diff)
downloade4-gan-tune_hyp.tar.gz
e4-gan-tune_hyp.tar.bz2
e4-gan-tune_hyp.zip
add dropouttune_hyp
-rwxr-xr-xcgan.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cgan.py b/cgan.py
index 6406244..68bb2cc 100755
--- a/cgan.py
+++ b/cgan.py
@@ -15,7 +15,7 @@ from tqdm import tqdm
import numpy as np
class CGAN():
- def __init__(self, dense_layers = 3):
+ def __init__(self, dense_layers = 3, dropout=0.4):
# Input shape
self.img_rows = 28
self.img_cols = 28
@@ -24,6 +24,7 @@ class CGAN():
self.num_classes = 10
self.latent_dim = 100
self.dense_layers = dense_layers
+ self.dropout = dropout
optimizer = Adam(0.0002, 0.5)
@@ -87,10 +88,10 @@ class CGAN():
model.add(LeakyReLU(alpha=0.2))
model.add(Dense(512))
model.add(LeakyReLU(alpha=0.2))
- model.add(Dropout(0.4))
+ model.add(Dropout(self.dropout))
model.add(Dense(512))
model.add(LeakyReLU(alpha=0.2))
- model.add(Dropout(0.4))
+ model.add(Dropout(self.dropout))
model.add(Dense(1, activation='sigmoid'))
#model.summary()