https://www.youtube.com/watch?v=T-MCludVNn4&t=262s&ab_channel=JeffHeaton
Check this video for the implementation of GANs in Keras.
I have tried this code, and I have modified a few things to improve the results.
Generator
- Use Up sampling 2D layer to increase image size in GAN
- Use Leaky Relu or Relu as an activation function
- Use BatchNormalization or Instance Normalization after each layer
Discriminator
- Don`t Use MaxPooling Layer, Because its gradient only exists for the max value that this layer returns not for other pixels, for the generator we need a gradient for all pixels, to improve the overall quality of the image.
Training
Try training Discriminator on both positive and negative samples together as a single batch or train them separately, and see which one improves your results.
Training Both Negative and positive samples together gives you the average loss of both samples, thus improving the overall quality of your model's weights.
You should see an output (with noise) bit similar to your target within 10 epochs, if not then change layers.
No comments:
Post a Comment