May 2019
Intermediate to advanced
272 pages
7h 19m
English
We add a wrapper that combines a 2D Convolution with Batchnorm and an optional ReLU. This sequence of layers is very common in this model. In using this wrapper, the code becomes more compact and easier to read:
def ConvBatchnormRelu(x, n_filters, kernel_size, strides, padding, relu=True): x = Conv2D(n_filters, kernel_size=kernel_size, strides=strides, padding=padding, kernel_initializer=w_init)(x) x = BatchNormalization(gamma_initializer=g_init)(x) if relu: x = Activation('relu')(x) return x
Let's take a look at the diagram provided by the authors before we implement the Discriminator and the Generator:

Read now
Unlock full access