December 2018
Intermediate to advanced
268 pages
8h 23m
English
The Generator class needs to have a few input variables such as the width, height, and channels of the input data. The latent space is also important as it helps define the size of the distribution that we will sample and the side of the neural network. The code is as follows:
class Generator(object): def __init__(self, width = 28, height= 28, channels = 1, latent_size=100): self.W = width self.H = height self.C = channels self.OPTIMIZER = Adam(lr=0.0002, decay=8e-9) self.LATENT_SPACE_SIZE = latent_size self.latent_space = np.random.normal(0,1, (self.LATENT_SPACE_SIZE,)) self.Generator = self.model() self.Generator.compile(loss='binary_crossentropy', optimizer=self.OPTIMIZER) self.Generator.summary()
A few ...
Read now
Unlock full access