Helper methods in the Discriminator class

There are a few helper methods that enable you to understand key information about the structures you are developing:

  1. The first method called summary will print the summary that's available from Keras of the model you produced previously:
def summary(self):
return self.Discriminator.summary()

The summary function should put out data just like this on the Terminal:

Layer (type)                 Output Shape              Param #   
=================================================================
flatten_1 (Flatten) (None, 784) 0
_________________________________________________________________
dense_6 (Dense) (None, 784) 615440
_________________________________________________________________
leaky_re_lu_5 (LeakyReLU) (None, 784) 0
_________________________________________________________________
dense_7 (Dense) (None, 392) 307720
_________________________________________________________________
leaky_re_lu_6 (LeakyReLU) (None, 392) 0
_________________________________________________________________
dense_8 (Dense) (None, 1) 393
=================================================================
Total params: 923,553
Trainable params: 923,553
Non-trainable params: 0
_________________________________________________________________
  1. Our next helper function, called save_model , produces the photographic version of the model structure:
def save_model(self):
plot_model(self.Discriminator.model,
to_file='/data/Discriminator_Model.png')

The output of the save model function will save an image just like this to the data folder:

Hence, you have now understood how to build your first GAN discriminator. 

 

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

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