January 2019
Intermediate to advanced
316 pages
8h 16m
English
The residual blocks contain two 2D convolutional layers, each followed by a batch normalization layer and an activation function.
def residual_block(input): """ Residual block in the generator network :return: """ x = Conv2D(128 * 4, kernel_size=(3, 3), padding='same', strides=1)(input) x = BatchNormalization()(x) x = ReLU()(x) x = Conv2D(128 * 4, kernel_size=(3, 3), strides=1, padding='same')(x) x = BatchNormalization()(x) x = add([x, input]) x = ReLU()(x) return x
The initial input is added to the output of the second 2D convolutional layer. The resultant tensor will be the output of the block.
Read now
Unlock full access