def inception_resnet_stem(input):
if K.image_dim_ordering() == "th":
channel_axis = 1
else:
channel_axis = -1
# Input Shape is 299 x 299 x 3 (tf) or 3 x 299 x 299 (th)
c = Convolution2D(32, 3, 3, activation='relu', subsample=(2, 2))(input)
c = Convolution2D(32, 3, 3, activation='relu', )(c)
c = Convolution2D(64, 3, 3, activation='relu', )(c)
c = MaxPooling2D((3, 3), strides=(2, 2))(c)
c = Convolution2D(80, 1, 1, activation='relu', border_mode='same')(c)
c = Convolution2D(192, 3, 3, activation='relu')(c)
c = Convolution2D(256, 3, 3, activation='relu', subsample=(2,2), border_mode='same')(c)
b = BatchNormalization(axis=channel_axis)(c)
b = Activation('relu')(b)
return b
评论列表
文章目录