Basic question in Build basic generative Adversial network C1W1 and C2W2 assignments


I was able to run the week one and week two assignments w.r.t to the GAN course, however I’m not able to understand the use-case of the assignment.
Here are my questions:

  1. Two images are generating in steps of training. Can you explain me what are those? how are they generated?
  2. In week2 assignment for Discriminator class, make_disc_block method, why we should not use activation function in final layer, without that how can we get output in classes?
  3. Can you explain the use-case on the training that we did in week2?
1 Like

Hi @Sneha_K_S ,

Your query was posted to AI Discussions forum. Looking at your question, it seems the forum of course3 -Apply generative adversarial network, is more relevant.

1 Like

Hi @Kic
Without having clarity with week one and week two assignments. How can we proceed?

1 Like

Please use the “pencil” icon in the thread title, and move your thread to the forum area for your course.

Then a mentor for your course will be more likely to find it.

1 Like

I have tagged the relevant course in the thread.

1 Like

Hi @Sneha_K_S, welcome to the GANS specialization!

I’ll take a stab at your questions. Please let me know if I’ve misunderstood what you’re asking on any of these:

In these two assignments, the training loop creates one fake image for training the generator, and one fake image for training the discriminator. These fake images are used in calculating the loss for the generator and discriminator, respectively. The generator creates these images from the noise input. At first, the images the generator creates are just random, but over time as it is trained, it produces better and better images (assuming the model is working well, of course.)

Good question. There is a comment in the first assignment that explains this, but it’s easy to overlook. It’s because the loss function we’re using, BCEWithLogitsLoss, includes the sigmoid function.

The week 2 assignment is basically doing the same thing as week 1 - training a GAN to draw digits using the MNIST database. The main difference is it is using DCGAN (Deep Convolutional GAN) to do it. This is mainly to demonstrate a simple example for you using a more “real-world” GAN (DCGAN). DCGANs have been used for a range of use-cases, from image generation for artists and video game designers, to supporting cancer lesion detection. One of the main useful aspects of DCGAN is its use of convolutional layers - you will be seeing a lot more of those, as well as more examples of use-cases as you continue with the course.

Happy learning!


Thanks so much @Wendy for answering this. That gives some ideas.

1 Like