def _ds_by_pl(data, name, level, dilate): assert level > 0 level_block = level_blocks[level] if not level_block.downsample == 'p': return data, dilate pool_stride = stride = 2 inc_dilate = level_block.dilate pad = -1 if inc_dilate: pool_stride = 1 pad = dilate print 'Pooling stride: {}, dilate: {}, pad: {}'.format(pool_stride, dilate, pad) top = pool(data, name, stride=pool_stride, dilate=dilate, pad=pad, pool_type=pool_type) if inc_dilate: dilate *= stride return top, dilate
def _ds_by_pl(data, name, level, dilate): assert level > 0 ds = level_blocks[level].downsample if not ds == 'p': return data, dilate stride = 2 inc_dilate = level_blocks[level].dilate pad = -1 if inc_dilate: stride = 1 pad = dilate print 'Pooling stride: {}, dilate: {}, pad: {}'.format(stride, dilate, pad) top = pool(data, name, stride=stride, dilate=dilate, pad=pad, pool_type=pool_type) if inc_dilate: dilate *= ds[1] return top, dilate
def rn_top(feat, fc_name, classes): pool7 = pool(feat, 'pool7', pool_type='avg', global_pool=True) scores = fc(pool7, fc_name, classes) return softmax_out(scores)
def rn_top_1(feat, fc_name, classes): poolc2 = pool(feat, 'poolc2', pool_type='avg', global_pool=True) fc1 = fc(poolc2, fc_name, 512) scoresF = fc(fc1, 'bCls1', classes) return sigmoid_out(scoresF)