744353138995f1b15933be6ee2d39f7b83ee1b1f,adversarial_autoencoder.py,AdversarialAutoencoder,train,#AdversarialAutoencoder#Any#Any#Any#,108
Before Change
encoded_x = np.concatenate((latent_real, latent_fake))
// First half are valid and second are fake
valid_y = np.array([1] * half_batch + [0] * half_batch).reshape(-1, 1)
// Train the discriminator
d_loss = self.discriminator.train_on_batch([encoded_x, imgs_x], [imgs_x, valid_y])
After Change
latent_real = np.random.normal(size=(half_batch, self.encoded_dim))
valid = np.ones((half_batch, 1))
fake = np.zeros((half_batch, 1))
// Train the discriminator
d_loss_real = self.discriminator.train_on_batch([latent_real, imgs], [imgs, valid])
d_loss_fake = self.discriminator.train_on_batch([latent_fake, gen_imgs], [gen_imgs, fake])
d_loss = 0.5 * np.add(d_loss_real, d_loss_fake)
// ---------------------
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 17
Instances
Project Name: eriklindernoren/Keras-GAN
Commit Name: 744353138995f1b15933be6ee2d39f7b83ee1b1f
Time: 2017-07-16
Author: eriklindernoren@live.se
File Name: adversarial_autoencoder.py
Class Name: AdversarialAutoencoder
Method Name: train
Project Name: eriklindernoren/Keras-GAN
Commit Name: 3cba7783cb805459d26918be7a56b0e8b8fd3bc9
Time: 2017-07-17
Author: eriklindernoren@live.se
File Name: context_encoder.py
Class Name: ContextEncoder
Method Name: train
Project Name: eriklindernoren/Keras-GAN
Commit Name: 3cba7783cb805459d26918be7a56b0e8b8fd3bc9
Time: 2017-07-17
Author: eriklindernoren@live.se
File Name: gan.py
Class Name: GAN
Method Name: train
Project Name: eriklindernoren/Keras-GAN
Commit Name: 744353138995f1b15933be6ee2d39f7b83ee1b1f
Time: 2017-07-16
Author: eriklindernoren@live.se
File Name: adversarial_autoencoder.py
Class Name: AdversarialAutoencoder
Method Name: train