GAN Training Generator Part

In Generator Section Code why we have used “binary_crossentropy” as a loss function ?

Hey @Blazer_007, binary_crossentropy loss function is used when our model has to predict two classes or distinguish between two classes. Here also we have two classes which the discriminator and generator have to deal with i.e fake images & real images. Hence we have used this loss function !

I hope this resolves your doubt !
Please mark the doubt as resolved in your doubts section ! :+1:
Happy Learning :slight_smile:

I know that but i am talking specifically about generator part where we take random noise vector of 100 dim and convert it into 784*1 dim vector here also we have used binary_crossentropy as a loss . Why ?

There also we consider two main classes as fake and real. The generator will generate fake images which closely resemble the real ones. So we try to play with 2 classes everywhere. Categorical function can only be used when your models is trying to differentiate between multiple classes. But in GANs , we only consider two classes i.e fake and real. For more explanation on this I would request you to refer to this link :slight_smile:

I hope this clears your doubt ! :+1:
Happy Learning :slight_smile:

Okay, got it .Thanks for the Blog , it was good!

1 Like