In your code, you set the discriminator to trainable without recompiling.
2 questions:
Does keras take this into account (the doc seems to imply that you need to compile for the trainable attribute to take effect ?
I inspected the trainable attribute of the layers of the GAN model after you set make_trainable(discriminator, True) line and got the following output:
(First column: layer name, Second column: layer.trainable)
GAN input_1 False
GAN dense_1 True
GAN batchnormalization_1 True
GAN activation_1 True
GAN reshape_1 True
GAN upsampling2d_1 True
GAN convolution2d_1 True
GAN batchnormalization_2 True
GAN activation_2 True
GAN convolution2d_2 True
GAN batchnormalization_3 True
GAN activation_3 True
GAN convolution2d_3 True
GAN activation_4 True
GAN input_2 True
GAN convolution2d_4 True
GAN leakyrelu_1 True
GAN dropout_1 True
GAN convolution2d_5 True
GAN leakyrelu_2 True
GAN dropout_2 True
GAN flatten_1 True
GAN dense_2 True
GAN leakyrelu_3 True
GAN dropout_3 True
GAN dense_3 True
which would imply that the GAN model actually updates the weights of the discriminator. Can you confirm whether this is the case ?
In your code, you set the discriminator to
trainable
without recompiling.2 questions:
trainable
attribute to take effect ?trainable
attribute of the layers of the GAN model after you setmake_trainable(discriminator, True)
line and got the following output:(First column: layer name, Second column: layer.trainable)
GAN input_1 False GAN dense_1 True GAN batchnormalization_1 True GAN activation_1 True GAN reshape_1 True GAN upsampling2d_1 True GAN convolution2d_1 True GAN batchnormalization_2 True GAN activation_2 True GAN convolution2d_2 True GAN batchnormalization_3 True GAN activation_3 True GAN convolution2d_3 True GAN activation_4 True GAN input_2 True GAN convolution2d_4 True GAN leakyrelu_1 True GAN dropout_1 True GAN convolution2d_5 True GAN leakyrelu_2 True GAN dropout_2 True GAN flatten_1 True GAN dense_2 True GAN leakyrelu_3 True GAN dropout_3 True GAN dense_3 True
which would imply that the GAN model actually updates the weights of the discriminator. Can you confirm whether this is the case ?