Generative adversarial networks (GANs) are a class of artificial intelligence algorithms used in unsupervised (and semi-supervised) machine learning, implemented by a system of two neural networks contesting with each other in a zero-sum game framework.
Questions tagged [generative-adversarial-network]
916 questions
32
votes
1 answer
DCGAN debugging. Getting just garbage
Introduction:
I am trying to get a CDCGAN (Conditional Deep Convolutional Generative Adversarial Network) to work on the MNIST dataset which should be fairly easy considering that the library (PyTorch) I am using has a tutorial on its website.
But I…

Lupos
- 896
- 12
- 40
27
votes
1 answer
How to interpret the discriminator's loss and the generator's loss in Generative Adversarial Nets?
I am reading people's implementation of DCGAN, especially this one in tensorflow.
In that implementation, the author draws the losses of the discriminator and of the generator, which is shown below (images come from…

shapeare
- 4,133
- 7
- 28
- 39
20
votes
2 answers
Scene Text Image Super-Resolution for OCR
I am working on an OCR system. A challenge that I'm facing for recognizing the text within ROI is due to the shakiness or motion effect shot or text that is not focus due to angle positions. Please consider the following demo sample
If you notice…

Innat
- 16,113
- 6
- 53
- 101
15
votes
2 answers
Add class information to keras network
I am trying to figure out how I will use the label information of my dataset with Generative Adversarial Networks. I am trying to use the following implementation of conditional GANs that can be found here. My dataset contains two different image…

Jose Ramon
- 5,572
- 25
- 76
- 152
14
votes
2 answers
How do I get a loss per epoch and not per batch?
In my understanding an epoch is an arbitrarily often repeated run over the whole dataset, which in turn is processed in parts, so called batches. After each train_on_batch a loss is calculated, the weights are updated and the next batch will get…

Sebastian
- 754
- 4
- 7
- 20
13
votes
1 answer
Why are the images generated by a GAN get darker as the network trains more?
I created a simple DCGAN with 6 layers and trained it on CelebA dataset (a portion of it containing 30K images).
I noticed my network generated images are dimmed looking and as the network trains more, the bright colors fade into dim ones!
here…

Hossein
- 24,202
- 35
- 119
- 224
11
votes
1 answer
Changing CNN to work with 3D convolutions
I am working with code from here (paper here) that creates a GAN. I am trying to apply this to a new domain, switching from their application on MNIST to 3D brain MRI images. My issue is in the defining of the GAN itself.
For example, their code…

Kyranstar
- 1,650
- 2
- 14
- 35
10
votes
3 answers
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation?
I am using pytorch-1.5 to do some gan test. My code is very simple gan code which just fit the sin(x) function:
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
# Hyper Parameters
BATCH_SIZE = 64
LR_G =…

tidy
- 4,747
- 9
- 49
- 89
10
votes
2 answers
Wasserstein loss can be negative?
I'm currently training a WGAN in keras with (approx) Wasserstein loss as below:
def wasserstein_loss(y_true, y_pred):
return K.mean(y_true * y_pred)
However, this loss can obviously be negative, which is weird to me.
I trained the WGAN for 200…

Piggy Wenzhou
- 305
- 2
- 10
8
votes
2 answers
After some number of epochs fake image creation become worst in GAN
I'm trying to create GAN model.
This is my discriminator.py
import torch.nn as nn
class D(nn.Module):
feature_maps = 64
kernel_size = 4
stride = 2
padding = 1
bias = False
inplace = True
def __init__(self):
…

AMendis
- 1,346
- 4
- 18
- 34
8
votes
3 answers
Why some people chain the parameters of two different networks and train them with same optimizer?
I was looking at CycleGAN's official pytorch implementation and there, author chained the parameters of both networks and used a single optimizer for both network. How does this work? Is it better than using two different optimizers for two…

Asjad Murtaza
- 101
- 1
- 3
8
votes
0 answers
Save and Load GAN model for continued training using Keras
I am trying to save a GAN model so that I can continue the training later.
Basically I am saving the discriminator and generator separately after the training loop, with these…

Tessmus
- 149
- 2
- 9
8
votes
2 answers
Tensorflow 2.0: How to change the output signature while using tf.saved_model
I would like to change the input and output signatures of the model saved, I used tf.Module objects to build the operations of the main model.
class Generator(tf.Module):
def __init__(....):
super(Generator, self).__init__(name=name)
…

Miguel Angel Alba Acosta
- 81
- 1
- 3
8
votes
1 answer
Difference between mode dropping and mode collapsing in GANs?
Recently I read a paper and they cited these two problems when training GANs. I know about mode collapsing, where the generator produces a limited varieties of samples, however I did not find a good explanation about mode dropping.
Does anyone have…

ibiscp
- 93
- 1
- 5
7
votes
1 answer
Why GAN is unable to generate samples from some distributions?
I'm tried to implement basic GAN in Keras, based on this implementation.
If I sample points on parabola GAN is converges and able to produce samples from this distribution, but if for example I sample points on circle it fails. I wonder why it's…

mrgloom
- 20,061
- 36
- 171
- 301