博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Multi-level Contextual 3D Convolutional Neural Networks
阅读量:6269 次
发布时间:2019-06-22

本文共 2895 字,大约阅读时间需要 9 分钟。

def multi_level_contextual(patch_size, n_channels, nb_classes):# number of convolutional filters to use at each layer    nb_filters = [64, 64, 64]    # level of pooling to perform at each layer (POOL x POOL)    nb_pool = [2, 2, 2]    # level of convolution to perform at each layer (CONV x CONV)    nb_conv = [5, 5, 5]    inputs = Input((patch_size, patch_size, patch_size, n_channels))    c1 = Conv3D(nb_filters[0], (nb_conv[0], nb_conv[0], nb_conv[0]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(inputs)    c2 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c1)    c3 = MaxPooling3D(pool_size=(nb_pool[0], nb_pool[0], nb_pool[0]))(c2)    c4 = SpatialDropout3D(0.5)(c3)    c5 = Conv3D(nb_filters[1],(nb_conv[1], nb_conv[1], nb_conv[1]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c4)        c6 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c5)    c7 = Conv3D(nb_filters[2],(nb_conv[2], nb_conv[2], nb_conv[2]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c6)    c8 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c7)    c9 = SpatialDropout3D(0.5)(c8)    c10 = Flatten()(c9)        c11 = Dense(256, kernel_initializer='glorot_normal', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c10)    c12 = Dense(nb_classes, kernel_initializer='glorot_normal', kernel_regularizer=regularizers.l2(0.01))(c11)    c13 = Activation('softmax')(c12)    c00 = Cropping3D(cropping=((patch_size//2-patch_size//4, patch_size//2+patch_size//4), (patch_size//2-patch_size//4, patch_size//2+patch_size//4), (patch_size//2-patch_size//4, patch_size//2+patch_size//4)))(inputs)    c01 = Conv3D(nb_filters[0], (nb_conv[0], nb_conv[0], nb_conv[0]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c00)    c02 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c01)    c03 = SpatialDropout3D(0.5)(c02)    c04 = Conv3D(nb_filters[1],(nb_conv[1], nb_conv[1], nb_conv[1]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c03)    c05 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c04)    c06 = Conv3D(nb_filters[2],(nb_conv[2], nb_conv[2], nb_conv[2]), padding='same', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c05)    c07 = BatchNormalization(epsilon=1e-06, momentum=0.9, weights=None)(c06)    c08 = SpatialDropout3D(0.5)(c07)    c09 = Flatten()(c08)    c010 = Dense(128, kernel_initializer='glorot_normal', activation='relu', kernel_regularizer=regularizers.l2(0.01))(c09)    c011 = Dense(nb_classes, kernel_initializer='glorot_normal', kernel_regularizer=regularizers.l2(0.01))(c010)    c012 = Activation('softmax')(c011)    model = Model(inputs=[inputs], outputs=[(c13+c012)/2])    return model

 

转载于:https://www.cnblogs.com/zhanfeng-xing/p/8876200.html

你可能感兴趣的文章
装饰器的邪门歪道
查看>>
Dubbo常用配置解析
查看>>
【转】C#解析Json Newtonsoft.Json
查看>>
macports的安装及常用命令
查看>>
(转)使用C#开发ActiveX控件
查看>>
spring mvc 基于注解 配置默认 handlermapping
查看>>
半小时学会上传本地项目到github
查看>>
Android学Jni/Ndk 开发记录(一)
查看>>
Linux Tcl和Expect的安装
查看>>
WPF中的依赖项属性(转)
查看>>
linux防火墙相关 iptables
查看>>
最简单的单例模式
查看>>
JPopupMenu的使用以及JPopupMenu中子组件的事件处理
查看>>
从反汇编的角度看引用和指针的区别
查看>>
拓马长枪定乾坤
查看>>
UIProgressView的详细使用
查看>>
Silverlight实用窍门系列:70.Silverlight的视觉状态组VisualStateGroup
查看>>
照片筛选与上传功能
查看>>
Hello ZED
查看>>
常见web攻击方式
查看>>