You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but it is slow ... I notice that it only uses one core ... this keras-adversarial package seams to be optimized to work with all cores ... that is why it is important.
If someone takes this task, it is important to have the accuracy metric (train/test) of the softmax on the discriminator side among with loss ..
In AC-GAN:
1 - the discriminator input is only the image : [image]
2 - the discriminator output is one softmax with N classes and one sigmoid to identify real/fake [labels,valid]
3 - the generator input is : [noise,label] (then they are multiplied to give color to the noise to be oriented to generate one class )
4 - the generator output is only one image : [image]
when training fake images the random labels to use in the generator to create images to train must be used also in the discriminator training , something like :
....
# Adversarial ground truths
valid = np.ones((batch_size, 1))
fake = np.zeros((batch_size, 1))
...
#inside train cycle
...
# real data
imgs = X_train[index * batch_size:(index + 1) * batch_size]
img_labels = y_train[index * batch_size:(index + 1) * batch_size]
#end real data
# generated data
noise = np.random.normal(0, 1, (batch_size, 100))
# The labels of the digits that the generator tries to create an
# image representation of
---> sampled_labels = np.random.randint(0, 10, (batch_size, 1))
# Generate a half batch of new images
---> gen_imgs = self.generator.predict([noise, sampled_labels])
#end generated data
# Train the discriminator
d_loss_real = self.discriminator.train_on_batch(imgs, [valid, img_labels])
---> d_loss_fake = self.discriminator.train_on_batch(gen_imgs, [fake, sampled_labels])
d_loss = 0.5 * np.add(d_loss_real, d_loss_fake)
...
if possible :-)
The text was updated successfully, but these errors were encountered:
A complete example of AC-GAN using keras-adversarial would be nice !
I have ac-gan implemented here :
https://github.com/rjpg/bftensor/blob/master/Autoencoder/src/ac-gan2.py
but it is slow ... I notice that it only uses one core ... this keras-adversarial package seams to be optimized to work with all cores ... that is why it is important.
If someone takes this task, it is important to have the accuracy metric (train/test) of the softmax on the discriminator side among with loss ..
In AC-GAN:
1 - the discriminator input is only the image : [image]
2 - the discriminator output is one softmax with N classes and one sigmoid to identify real/fake [labels,valid]
3 - the generator input is : [noise,label] (then they are multiplied to give color to the noise to be oriented to generate one class )
4 - the generator output is only one image : [image]
when training fake images the random labels to use in the generator to create images to train must be used also in the discriminator training , something like :
if possible :-)
The text was updated successfully, but these errors were encountered: