compute.py 文件源码

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

项目:paradox 作者: ictxiangxin 项目源码 文件源码
def compute_max_unpooling_nd(data, pooling, size, step, dimension: int):
    result = []
    data_prefix_shape = data.shape[:-dimension]
    kernel_prefix_shape = pooling.shape[:-dimension]
    final_shape = element_wise_shape(data_prefix_shape, kernel_prefix_shape)[0]
    data = numpy.broadcast_to(data, final_shape + data.shape[-dimension:])
    pooling = numpy.broadcast_to(pooling, final_shape + pooling.shape[-dimension:])
    if final_shape:
        for key in array_index_traversal(final_shape):
            result.append(__compute_max_unpooling_nd(data[key], pooling[key], size, step, dimension))
        return numpy.array(result).reshape(final_shape + result[0].shape)
    else:
        return __compute_max_unpooling_nd(data, pooling, size, step, dimension)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号