I use the following piece of code:
U, S, V = torch.pca_lowrank(A, q=self.n_components)
self.V = V
self.projection = torch.matmul(A, V)
How to compute the cumulative percent variance or any other accuracy metric (single value between 0 and 100%) based on the above values returned? It's ok to project the matrix back with
approx = torch.matmul(self.projection, self.V.T)
if that helps with computing the metric.
I don't mind using other packages compatible with PyTorch.