ResNet v2
After the release of the second paper on ResNet [4], the original model presented in the previous section has been known as ResNet v1. The improved ResNet is commonly called ResNet v2. The improvement is mainly found in the arrangement of layers in the residual block as shown in following figure.
The prominent changes in ResNet v2 are:
The use of a stack of 1 × 1 - 3 × 3 - 1 × 1
BN-ReLU-Conv2D
Batch normalization and ReLU activation come before 2D convolution
ResNet v2 is also implemented in the same code as resnet-cifar10-2.2.1.py
:
def resnet_v2(input_shape, depth, num_classes=10): if (depth - 2) % 9 != 0: raise ValueError('depth should be 9n+2 (eg 56 or 110 in [b])') # Start model definition. num_filters_in = 16 num_res_blocks = int((depth - 2) / 9) inputs = Input(shape=input_shape) # v2 performs Conv2D with BN-ReLU on input # before splitting into 2 paths x = resnet_layer...