diff --git a/ch12/autoencoder.py b/ch12/autoencoder.py index d3f19c463..579516951 100644 --- a/ch12/autoencoder.py +++ b/ch12/autoencoder.py @@ -111,8 +111,7 @@ def call(self, inputs, training=None): x_hat = tf.reshape(x_hat, [-1, 28, 28]) # [b, 28, 28] => [2b, 28, 28] - x_concat = tf.concat([x, x_hat], axis=0) - x_concat = x_hat + x_concat = tf.concat([x[:50], x_hat[:50]], axis=0) x_concat = x_concat.numpy() * 255. x_concat = x_concat.astype(np.uint8) save_images(x_concat, 'ae_images/rec_epoch_%d.png'%epoch) diff --git a/ch12/vae.py b/ch12/vae.py index 583ed33b8..fe65718a4 100644 --- a/ch12/vae.py +++ b/ch12/vae.py @@ -102,7 +102,7 @@ def call(self, inputs, training=None): model.build(input_shape=(4, 784)) optimizer = tf.optimizers.Adam(lr) -for epoch in range(1000): +for epoch in range(100): for step, x in enumerate(train_db):