Skip to content

Instantly share code, notes, and snippets.

@szymonk92
Created September 8, 2017 02:09
Show Gist options
  • Save szymonk92/b28a128757027e966ef23d0309d86b93 to your computer and use it in GitHub Desktop.
Save szymonk92/b28a128757027e966ef23d0309d86b93 to your computer and use it in GitHub Desktop.
# VGG16
modelVGG = Sequential([
Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1', input_shape=X[1, :].shape),
Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2'),
MaxPooling2D((2, 2), strides=(2, 2), name='block1_pool'),
Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv1'),
Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv2'),
MaxPooling2D((2, 2), strides=(2, 2), name='block2_pool'),
Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv1'),
Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv2'),
Conv2D(256, (3, 3), activation='relu', padding='same', name='block3_conv3'),
MaxPooling2D((2, 2), strides=(2, 2), name='block3_pool'),
# Block 4
Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv1'),
Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv2'),
Conv2D(512, (3, 3), activation='relu', padding='same', name='block4_conv3'),
MaxPooling2D((2, 2), strides=(2, 2), name='block4_pool'),
# Block 5
Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv1'),
Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv2'),
Conv2D(512, (3, 3), activation='relu', padding='same', name='block5_conv3'),
MaxPooling2D((2, 2), strides=(2, 2), name='block5_pool'),
Flatten(name='flatten'),
Dense(4096, activation='relu', name='fc1'),
Dense(4096, activation='relu', name='fc2'),
Dense(num_classes, activation='softmax', name='predictions')
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment