def _conv_block(layer, num_conv_layers, num_filters):
"""Build a conv block on top of inputs
:param inputs: Keras Layer object representing the VGG net up to this
point
:param num_conv_layers: int for the number of convolutional layers to
include in this block
:param num_filters: int for the number of filters per convolutional
layer
"""
for _ in range(num_conv_layers - 1):
layer = Conv2D(
filters=num_filters, kernel_size=(3, 3), padding='same',
activation='relu'
)(layer)
layer = MaxPooling2D(pool_size=(2, 2), strides=(2, 2))(layer)
return layer
评论列表
文章目录