代码拉取完成,页面将自动刷新
from keras.layers import Dense, Dropout, Conv2D, Input, MaxPool2D, Flatten
from keras.models import Model
from keras.layers.normalization import BatchNormalization
from keras.layers import ELU
def proposed_model(input_h=128, input_w=128):
input_shape = (input_h, input_w, 3)
nb_classes = 8
inputs = Input(input_shape)
# layer 1
x = Conv2D(64, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(inputs)
x = ELU()(x)
x = BatchNormalization()(x)
# layer 2
x = Conv2D(64, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(x)
x = ELU()(x)
x = BatchNormalization()(x)
# layer3
x = MaxPool2D(pool_size=(2, 2), strides=(2, 2))(x)
# layer4
x = Conv2D(128, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(x)
x = ELU()(x)
x = BatchNormalization()(x)
# layer5
x = Conv2D(128, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(x)
x = ELU()(x)
x = BatchNormalization()(x)
# layer6
x = MaxPool2D(pool_size=(2, 2), strides=(2, 2))(x)
# layer7
x = Conv2D(256, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(x)
x = ELU()(x)
x = BatchNormalization()(x)
# layer 8
x = Conv2D(256, (3, 3), strides=(1, 1), kernel_initializer='glorot_uniform')(x)
x = ELU()(x)
x = BatchNormalization()(x)
# layer 9
x = MaxPool2D(pool_size=(2, 2), strides=(2, 2))(x)
x = Flatten()(x)
# layer 10
x = Dense(2048)(x)
x = ELU()(x)
x = BatchNormalization()(x)
x = Dropout(0.5)(x)
x = Dense(nb_classes, activation='softmax')(x)
model = Model(inputs, x)
return model
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。