Hi Jack!



 Jack_Rolph:

I am looking to find only the primary eigenvector of a real, positive-definite symmetric 20x2000x2000 tensor:
…
Can anyone suggest a faster way of finding the first eigenvector?


You might find that the Lanczos method 60 runs faster.
Also, it may even make sense to bump over into scipy (a numpy
relative), and use an established implementation, for example,
scipy.sparse.linalg.eigs 11.  The careful implementation might beat
pytorch tensors on the gpu.
(I’m pretty sure that it becomes equivalent to Lanczos for your real
SPD use case.)
As for getting autograd / backward() to work, I don’t have anything
useful to say.
[Note to the Pytorch Mavens:  I think I’ve seen questions like this
before.  I don’t personally have a pytorch use case for the top-k
eigenvectors, but is this common enough that it might make sense
to implement an autograd / gpu-friendly top-k eigenvector function?]
Best.
K. Frank