refit_unet_d8g_222_swrap_08.py 文件源码

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

项目:kaggle_dsb2017 作者: astoc 项目源码 文件源码
def data_from_grid_by_proximity (cells, gridwidth, gridheight, grid=32):

    # disperse the sequential dats into layers and then use data_from_grid
    shape = cells.shape
    new_shape_1_dim = shape[0]// (gridwidth * gridheight)  # ws // 36 -- Improved on 20170306


    ### NOTE tha we invert the order of shapes below to get the required proximity type ordering
    new_shape = (new_shape_1_dim, gridwidth * gridheight,  ) +  tuple([x for x in shape][1:])   # was 36,  Improved on 20170306
    #new_shape = (gridwidth * gridheight, new_shape_1_dim, ) +  tuple([x for x in shape][1:])   # was 36,  Improved on 20170306

    # swap ordering of axes 
    cells = np.reshape(cells, new_shape) 
    cells = cells.swapaxes(0, 1)
    cells = np.reshape(cells, shape) 

    cells = data_from_grid (cells, gridwidth, gridheight, grid)

    return cells
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号