def _svd(self, X, max_rank=None):
if max_rank:
# if we have a max rank then perform the faster randomized SVD
return randomized_svd(
X,
max_rank,
n_iter=self.n_power_iterations)
else:
# perform a full rank SVD using ARPACK
return np.linalg.svd(
X,
full_matrices=False,
compute_uv=True)
评论列表
文章目录