Adaptive RandomizedERAReductor#2423
Conversation
9fb0853 to
614767f
Compare
|
The status of the branch is still pre "Great Transposition", I will have to carefully migrate everything after my holiday. |
|
@sdrave Thanks for transposing. I've checked out your changes and they look good. I could reproduce the results from my paper, so numerically (at least with the LOO estimator) it is fine. I will add descriptive docstrings and tests soon! |
Codecov Report❌ Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@sdrave I am pretty happy with it now. Maybe there is a more elegant way using pyMOR defaults to set the |
|
Thanks, @artpelling. I'm very busy this week. Will try to look into the PR by the end of next week. |
sdrave
left a comment
There was a problem hiding this comment.
Hi @artpelling, sorry for the long waiting time. Could you move the changes in rand_la.py to a different PR and briefly explain the changes made?
|
With #2556 being merged, could you rebase on main, @artpelling? |
sdrave
left a comment
There was a problem hiding this comment.
Hi @artpelling, thanks again for the PR. I have taken a closer look now. There are two things I'd like to discuss:
-
You are doing the actual SVD part of the randomized SVD in
reduceinstead of callingrandomized_svd. If I understand correctly, the reasons for this are that:randomized_svddoes not support error tolerances,randomized_svdcannot be called repeatedly for different tolerances/ranks
without completely recomputing the approximate range of_H.
I feel that both points would be better addressed by improving
randomized_svd. At least the missing tolerance parameter(s) should be definitely added there. Regarding different ranks: do you really need the ability to increase the rank a posteriori? (Decreasing it could be done by simply caching the SVD and truncating it as needed.) If yes, I think we should consider something like aRandomizedSVDclass, or the possiblity to pass/return aRandomizedRangeFinderto/fromrandomized_svd. -
Can you explain why you need
num_left/num_rightin the constructor for the randomized version? If this is only about recycling the range finder, you could also keep theses parameters inreduceand throw the range finder away in case their values change. Alternatively, one could also move these parameters to the constructor for the deterministic version?
I think that if we address both points, then both ERA versions would share a lot more code, making it easier to see where the differences lie. Also maintaining the code would be easier ... - What do you think?
Yes.
The design of
Yes that is the key feature for me. Knowing the target model order is impossible for me. The appeal of the adaptive pipeline is that I can always come back later to refine.
I want it in the constructor for the reason you described. I dislike throwing away the range finder because I cannot revert this (imagine a setting where I play around with different tangential directions). For me, different number of tangential directions all need a dedicated reductor. For classical ERA, it is a nice feature that one can have caching for different tangential directions. Because this reductor cannot be applied to very large problems anyway, caching more also does not hurt in most cases. The inconsistency in API is warranted IMO (I though a lot about this as I remember). We can of course discuss this.
I agree that the architecture could be improved a bit more. However, I also see that this feature is open for a long time now and I think the |
Let me see if I can come up with a reasonable BTW, have you considered using oversampling in your algorithm, @artpelling? |
|
@artpelling, I have implemented a Before merging #2566 some documentation would be needed. I'd also like to think about adding more tolerance parameters to |
Thanks! It looks quite good. I would need to run some tests but I think I would need a SciPy SVD. It would be okay for me if pyMOR did not support that natively, as long as I can monkey patch Regarding the tolerances, I am not sure and they are intertwined with the error estimator in the range finder. I suppose it would make most sense to have |
I just added a
I agree that everything else might get messy. I have added the standard tolerance parameters. From my perspective, #2566 is now feature complete. I will add documentation/more tests after you had a chance to check if the design is sufficient for you, @artpelling. |
|
@sdrave I've just rebased on main but have a paper deadline. I can start integrating the new class in August. Feel free to move ahead without me though :) I should definitely be able to have this complete by the hard freeze 👍 |
This PR adds a new
RandomizedERAReductorbased on (https://doi.org/10.1137/20M1327616).I've also corrected a mistake in the error bound of the original
ERAReductorthat originated from a typo in the original paper.The
RandomizedERAReductorcan also be used in an adaptive way by using a leave-one-out error estimator that I will introduce in an upcoming paper. The estimator is not a true upper bound for the error but very fast to evaluate and performs much better than all other available estimators in practice (the established error bounds are grossly conservative).