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
评论列表
文章目录