Fisher.py 文件源码

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

项目:FisherDisc 作者: makagan 项目源码 文件源码
def condensed_svd(self, M, tol=1e-3, store_singular_vals=False):
        U, S, Vt = linalg.svd(M, full_matrices=False)
        if store_singular_vals:
            self.singular_vals = S

        #want tolerance on fraction of variance in singular value
        #when not norm_covariance, need to normalize singular values
        S_norm = np.sum(S)

        rank = np.sum( (S/S_norm) > tol )

        return U[:,:rank], S[:rank], Vt[:rank,:], S_norm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号