[WIP] add randomized projector #263
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress to add a randomized projector that uses randomized SVD. It imposes fullinfinite environment (it is also possible to define it for halfinfinite, but there should be little performance gain while loosing accuracy so I think it is not worth it).
The logic is
FourQuadrantsmax_full, compute SVD of full blockmax_full, compute a random range forn + oversamplingvalue, wherenis the number of values kept in previous iterationsn_subspace_iteriterations to improve range accuracy and get faster decaying singular spectrum.The point is to reuse information from previous iteration to predict each sector size. The same logic may be used for a Kyrlov implementation too. Currently,
max_full,n_subspace_iterandoversamplingare fixed (I had issues withleading_boundaryinterface).The implementations follows https://gregorygundersen.com/blog/2019/01/17/randomized-svd/, which is a nice explanation of Halko et al's 2011 paper. I also took inspirations from https://scikit-learn.org/stable/modules/generated/sklearn.utils.extmath.randomized_svd.html#rf38c2b656ebc-1 for the details of the subspace iterations.
The performances are impressive. The accuracy is worse than the full case and more iterations are needed, but it still converges (need to benchmark harder cases) and the total time is lower. I still need to benchmark with Krylov projector.
TODO:
max_fulland other parameters as true defaults and allow to set them