multiinputsequential.py 文件源码

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

项目:ddnn 作者: kunglab 项目源码 文件源码
def max_pool_avg_pool(self, hs):
        num_output = len(hs[0]) 
        houts = []
        i = 0
        shape = hs[0][i].shape
        h = F.dstack([F.reshape(h[i],(shape[0], -1)) for h in hs])
        x = 1.0*F.max(h,2)
        x = F.reshape(x, shape)
        houts.append(x)

        for i in range(1,num_output):
            shape = hs[0][i].shape
            h = F.dstack([F.reshape(h[i],(shape[0], -1)) for h in hs])
            x = 1.0*F.sum(h,2)/h.shape[2]
            x = F.reshape(x, shape)
            houts.append(x)
        return houts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号