I am a bit confised about how to use the Lanczos method in ViennaCL. I have a rectangular-matrix A and I would like to implement a PCA method using ViennaCL.
However from what I understood, Lanczos can only applies to Hermitian matrices. Do I need first to compute A^tA via "viennacl::linalg::prod" and then perform the Lanczos method on the resultut of the product ?
Thanks,
Olivier
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, Lanczos only works for symmetric matrices (note that ViennaCL does not support complex arithmetic, so Hermitian and symmetric is the same in this context). You can use Lanczos for A^tA, but keep in mind that you only get approximations to the largest singular values of A in this setting.
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there any other method to get more accurate result ?
Besides I don't understand something. When I profile my lanczos application, it seems to perform some CPU accesses while executing on the GPU. I am not quite sure but I have the impression that a part of the computation is perform on the CPU side.
Thanks
Olivier
Last edit: Olivier 2016-03-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
depends on what you need: Is your matrix dense or sparse? Do you need the full spectrum, only a part of the spectrum, or just the largest eigenvalue? In each case you will want to use a different type of algorithm.
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear everyone,
I am a bit confised about how to use the Lanczos method in ViennaCL. I have a rectangular-matrix A and I would like to implement a PCA method using ViennaCL.
However from what I understood, Lanczos can only applies to Hermitian matrices. Do I need first to compute A^tA via "viennacl::linalg::prod" and then perform the Lanczos method on the resultut of the product ?
Thanks,
Olivier
Hi Olivier,
yes, Lanczos only works for symmetric matrices (note that ViennaCL does not support complex arithmetic, so Hermitian and symmetric is the same in this context). You can use Lanczos for A^tA, but keep in mind that you only get approximations to the largest singular values of A in this setting.
Best regards,
Karli
Thank you for your explaination.
Is there any other method to get more accurate result ?
Besides I don't understand something. When I profile my lanczos application, it seems to perform some CPU accesses while executing on the GPU. I am not quite sure but I have the impression that a part of the computation is perform on the CPU side.
Thanks
Olivier
Last edit: Olivier 2016-03-30
Hi Olivier,
depends on what you need: Is your matrix dense or sparse? Do you need the full spectrum, only a part of the spectrum, or just the largest eigenvalue? In each case you will want to use a different type of algorithm.
Best regards,
Karli