Home > Software engineering >  SVD for low rank matrices
SVD for low rank matrices

Time:10-20

Does anyone know how to do svd for low-ranked matrices in python? I could not find any built in function, should I write the code myself? I am doing sad on a 80*50 matrix with rank 10, so numpy svd does not work for me.

CodePudding user response:

This works perfectly fine for me:

import numpy as np
matrix = np.zeros((80,50))
matrix[:10,:10] = np.eye(10)

np.linalg.svd(matrix)

Reference

CodePudding user response:

PyTorch has a special low rank SVD implementation

  • Related