def Build(model_list):
print model_list
for idx, layer in enumerate(model_list):
type = layer[0]
if type == 'InputLayer':
input = Input(shape=layer[1])
x = input
elif type == 'Conv2D':
x = Conv2D(filters=layer[2], kernel_size=layer[1], padding='same')(x)
elif type == 'InceptionBlock':
x = inception_block(x, idx)
elif type == 'ResidualBlock':
x = residual_block(x, layer[1], idx)
elif type == "GlobalMaxPooling2D":
x = GlobalMaxPooling2D()(x)
elif type == "Activation":
x = Activation('softmax')(x)
model = Model(inputs=input, outputs=x)
return model
评论列表
文章目录