aboutsummaryrefslogtreecommitdiff
path: root/dcgan.py
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2019-03-05 14:32:38 +0000
committerVasil Zlatanov <v@skozl.com>2019-03-05 14:32:38 +0000
commit6b573a30a3021d259400af9751645eb1a5b4705b (patch)
tree09d68aa13d19062369f5044bf246ddd89a579fdb /dcgan.py
parent740e1b0c6a02a7bec20008758373f0dd80baade4 (diff)
parent2a720c237259baa2d968286244f9e43794c7e4d9 (diff)
downloade4-gan-6b573a30a3021d259400af9751645eb1a5b4705b.tar.gz
e4-gan-6b573a30a3021d259400af9751645eb1a5b4705b.tar.bz2
e4-gan-6b573a30a3021d259400af9751645eb1a5b4705b.zip
Full featured VBN
Diffstat (limited to 'dcgan.py')
-rw-r--r--dcgan.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dcgan.py b/dcgan.py
index eca1852..8a1bc2b 100644
--- a/dcgan.py
+++ b/dcgan.py
@@ -124,7 +124,7 @@ class DCGAN():
return Model(img, validity)
- def train(self, epochs, batch_size=128, save_interval=50):
+ def train(self, epochs, batch_size=128, save_interval=50, VBN=False):
# Load the dataset
(X_train, _), (_, _) = mnist.load_data()
@@ -139,6 +139,7 @@ class DCGAN():
xaxis = np.arange(epochs)
loss = np.zeros((2,epochs))
+
for epoch in tqdm(range(epochs)):
# ---------------------
@@ -150,7 +151,6 @@ class DCGAN():
imgs = X_train[idx]
tf.keras.backend.get_session().run(tf.global_variables_initializer())
-
# Sample noise and generate a batch of new images
noise = np.random.normal(0, 1, (batch_size, self.latent_dim))
gen_imgs = self.generator.predict(noise)