Architecture of the InfoGAN

Okay. What is really going on here? why are we doing this? To put it in simple terms, we split the input to the generator into two: z and c. Since both z and c are used for generating the image, they capture the semantic meaning of the image. The code c gives us the interpretable disentangled information about the image. So we try to find c given the generator output. However, we can't do this easily since we don't know the posterior, , so we use an auxiliary distribution, , to learn c.

This auxiliary distribution is basically another neural network; let's call this network as Q network. The role of the Q network is to predict the likelihood of c given a generator image x and is given by .

First, we sample c from a prior, p(c). Then we concatenate c and z and feed them to the generator. Next, we feed the generator result given by to the discriminator. We know that the role of the discriminator is to output the probability of the given image being real. So, it takes the image generated by the generator and returns the probability. Also, the Q network takes the generated image and returns the estimates of c given the generated image.

Both the discriminator D and Q networks take the generator image and return the output so they both share some layers. Since they both share some layers, we attach the Q network to the discriminator, as shown in the following diagram:

Thus, the discriminator returns two outputs:

  • The probability of the image being real
  • The estimates of c, which is the probability of c given the generator image

We add the mutual information term to our loss function.

Thus, the loss function of the discriminator is given as:

The loss function of the generator is given as:

Both of the preceding equations implies we are minimizing the loss of GAN along with maximizing the mutual information. Still confused about InfoGANs? Don't worry! We will learn about InfoGANs step by step better by implementing them in TensorFlow.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset