Set trainable to false after compile

In the Assignement there is this section:

discriminator.compile(loss = “binary_crossentropy”, optimizer = “rmsprop”)
discriminator.trainable = False

If I set discriminator.trainable to True, then the network always produce the same fake images, that is more or less random noise, there is indeed some structure but it has nothin in common with hands.

Why is that? If I set it to False it works as expected and produces hands.
But in the training loop there is the command where the discriminator is set to True/False anyway? And before there command in the training loop the discriminator isnt just at all?

This is video that explains your questions, and you might have missed you: https://www.coursera.org/learn/generative-deep-learning-with-tensorflow/lecture/Q8Kax/first-gan-training-loop

Thx for your fast reply. But I have watched the video carefully before doing the assignment, and I have well understood that in Phase 1 the discriminator is trained with trainable weights and in Phase 2 it is frozen, perfectly fine.

But again:
why is the discriminator set to FALSE right after compiling

and while training before the first train on batch set to true again?

And the problem with that is, tht it produces completely different results…thats important

No need to publish code here, its not helping others.

If the discriminator is set to False after the discriminator is compiled, it will not affect the training of the discriminator. But because it is False before the combined Gan model is compiled the discriminator layers will be frozen when the combined model is trained. And you understand the part that its trainable in faze 1 and then frozen when the time comes to train the gan.