Пример #1
0
def model_core_squeezenet12(x, mode, params, info):
    y, info = layer.conv2d_batch_norm_relu_dropout_l(x, mode, params, info, filters=32, kernel_size=6, strides=2)  # output 128x128
    y, info = layer.maxpool_l(y, info)  # output 64x64
    y, info = layer.sqnet_squeeze(y, mode, params, info, 21)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*26)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 36)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*46)
    y, info = layer.maxpool_l(y, info)  # output 32x32
    y, info = layer.sqnet_squeeze(y, mode, params, info, 41)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*36)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 31)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*26)
    y, info = layer.maxpool_l(y, info)  # output 16x16
    y, info = layer.sqnet_squeeze(y, mode, params, info, 21)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*16, last=True)
    return y, info
Пример #2
0
 def sqnet_squeeze_expand(x, mode, params, info, depth_increment, last=False):
     """Squeezenet "fire" module, i.e. a "squeeze" module followed by an "expand" module."""
     depth = int(x.get_shape()[3])//2
     depth += depth_increment
     x, info = layer.sqnet_squeeze(x, mode, params, info, depth)
     depth += depth_increment
     x, info = layer.sqnet_expand(x, mode, params, info, 2*depth, last=last)
     return x, info
Пример #3
0
def model_core_squeezenet17(x, mode, params, info):
    y, info = layer.conv2d_batch_norm_relu_dropout_l(x, mode, params, info, filters=128, kernel_size=3, strides=1)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*64)
    y, info = layer.maxpool_l(y, info)  # output 128x128
    #y, info = layer.sqnet_squeeze_pool(y, mode, params, info, 80)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 80)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*96)
    y, info = layer.maxpool_l(y, info)  # output 64x64
    #y, info = layer.sqnet_squeeze_pool(y, mode, params, info, 104)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 104)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*112)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 120)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*128)
    y, info = layer.maxpool_l(y, info)  # output 32x32
    #y, info = layer.sqnet_squeeze_pool(y, mode, params, info, 120)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 120)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*112)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 104)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*96)
    y, info = layer.maxpool_l(y, info)  # output 16x16
    #y, info = layer.sqnet_squeeze_pool(y, mode, params, info, 88)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 88)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*80)
    y, info = layer.sqnet_squeeze(y, mode, params, info, 72)
    y, info = layer.sqnet_expand(y, mode, params, info, 2*65, last=True)
    return y, info