features.py 文件源码

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

项目:cg 作者: michaelhabeck 项目源码 文件源码
def gradient(self, x, D=None):
        """
        Return gradient
        """
        dx = np.array([np.subtract.outer(x[:,d],x[:,d]) for d in range(x.shape[1])])

        D  = calc_distances(x) if D is None else D
        D  = D**(-0.5*self.n-1)
        D  = squareform(D)

        g = - self.n * dx * D

        return g.sum(-1).T
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号