strf.py 文件源码

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

项目:spykes 作者: KordingLab 项目源码 文件源码
def make_cosine_basis(self):
        '''Makes a spatial cosine and sine basis.

        Returns:
            list: A list where each entry is a 2D array of size
            :data:`(patch_size, patch_size)` specifing the spatial basis.
        '''
        patch_size = self.patch_size
        cosine_mask = np.zeros((patch_size, patch_size))
        sine_mask = np.zeros((patch_size, patch_size))
        for row in np.arange(patch_size):
            for col in np.arange(patch_size):
                theta = np.arctan2(patch_size / 2 - row, col - patch_size / 2)
                cosine_mask[row, col] = np.cos(theta)
                sine_mask[row, col] = np.sin(theta)

        spatial_basis = list()
        spatial_basis.append(cosine_mask)
        spatial_basis.append(sine_mask)
        return spatial_basis
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号