base_enhancement.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:NetworkCompress 作者: luzai 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号