Menu

Lanczos method

Olivier
2016-03-26
2016-03-31
  • Olivier

    Olivier - 2016-03-26

    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

     
  • Karl Rupp

    Karl Rupp - 2016-03-29

    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

     
  • Olivier

    Olivier - 2016-03-30

    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
  • Karl Rupp

    Karl Rupp - 2016-03-31

    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

     

Log in to post a comment.