posecell_network.py 文件源码

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

项目:spiking-ratslam 作者: bjkomer 项目源码 文件源码
def compute_activity_matrix(self, xywrap, thwrap, wdim, pcw): 
        """Compute the activation of pose cells. Taken from Renato de Pontes Pereira"""

        # The goal is to return an update matrix that can be added/subtracted
        # from the posecell matrix
        pca_new = np.zeros([PC_DIM_XY, PC_DIM_XY, PC_DIM_TH])

        # for nonzero posecell values  
        indices = np.nonzero(self.posecells)

        for i,j,k in itertools.izip(*indices):
            pca_new[np.ix_(xywrap[i:i+wdim], 
                           xywrap[j:j+wdim],
                           thwrap[k:k+wdim])] += self.posecells[i,j,k]*pcw

        return pca_new
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号