Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor greedy algorithms #757

Merged
merged 5 commits into from Sep 10, 2019
Merged

Refactor greedy algorithms #757

merged 5 commits into from Sep 10, 2019

Conversation

sdrave
Copy link
Member

@sdrave sdrave commented Aug 28, 2019

In this PR, pymor.algorithms.greedy.greedy is refactored into a weak_greedy function, working with an arbitrary surrogate for the greedy approximation error, and a rb_greedy function, which calls weak_greedy with an RBSurrogate. Similarly, adaptive_greedy has been refactored into adaptive_weak_greedy and rb_adaptive_greedy.

Further changes:

  • The old methods greedy and adaptive_greedy have been deprecated.
  • In rb_greedy, the samples argument has been renamed to training_set.

A strong_greedy function directly working on VectorArrays will follow in the future.

getting_started.rst still requires updating.

@sdrave sdrave added pr:change rb labels Aug 28, 2019
@sdrave sdrave added this to the 2019.2 milestone Aug 28, 2019
@sdrave sdrave requested a review from ftalbrecht Aug 28, 2019
sdrave added 2 commits Aug 28, 2019
- add weak_greedy, adaptive_weak_greedy algorithms which work on
  generic surrogates for the approximation error
- make rb versions special instances of weak_greedy/adaptive_weak_greedy
- rename rb versions to rb_greedy/rb_adaptive_greedy and deprecate old
  names
@codecov
Copy link

@codecov codecov bot commented Aug 28, 2019

Codecov Report

Merging #757 into master will decrease coverage by 0.32%.
The diff coverage is 87.19%.

Impacted Files Coverage Δ
src/pymor/algorithms/greedy.py 83.78% <82.52%> (-1.55%) ⬇️
src/pymor/algorithms/adaptivegreedy.py 84.81% <92%> (+1.19%) ⬆️
src/pymor/vectorarrays/constructions.py 14.28% <0%> (-85.72%) ⬇️
src/pymor/parallel/manager.py 82.35% <0%> (-17.65%) ⬇️
src/pymor/parallel/interfaces.py 65.62% <0%> (-3.13%) ⬇️
src/pymor/vectorarrays/numpy.py 83.03% <0%> (-0.76%) ⬇️
src/pymor/algorithms/riccati.py 90.16% <0%> (-0.32%) ⬇️
src/pymor/reductors/basic.py 77.58% <0%> (ø) ⬆️
src/pymor/algorithms/lrradi.py
src/pymor/core/interfaces.py 79.86% <0%> (+0.33%) ⬆️
... and 3 more

@codecov
Copy link

@codecov codecov bot commented Aug 28, 2019

Codecov Report

Merging #757 into master will increase coverage by <.01%.
The diff coverage is 87.25%.

Impacted Files Coverage Δ
src/pymor/algorithms/greedy.py 83.78% <82.52%> (-1.55%) ⬇️
src/pymor/algorithms/adaptivegreedy.py 84.81% <92.07%> (+1.19%) ⬆️
src/pymor/parallel/manager.py 82.35% <0%> (-17.65%) ⬇️
src/pymor/parallel/interfaces.py 65.62% <0%> (-3.13%) ⬇️
src/pymor/core/interfaces.py 79.86% <0%> (+0.33%) ⬆️

Copy link
Member

@ftalbrecht ftalbrecht left a comment

I did not check the new algorithms in detail. Just a general question: why rb_adaptive_greedy and not adaptive_rb_greedy? It seems to me the latter would fit the other names a bit better...

src/pymor/algorithms/greedy.py Outdated Show resolved Hide resolved
src/pymor/algorithms/greedy.py Outdated Show resolved Hide resolved
src/pymor/algorithms/greedy.py Outdated Show resolved Hide resolved
@sdrave
Copy link
Member Author

@sdrave sdrave commented Sep 9, 2019

why rb_adaptive_greedy and not adaptive_rb_greedy? It seems to me the latter would fit the other names a bit better...

I prefer rb_adaptive_greedy as it is the rb version (using the rb surrogate) of the adaptive_greedy algorithm.

@sdrave
Copy link
Member Author

@sdrave sdrave commented Sep 9, 2019

I prefer rb_adaptive_greedy as it is the rb version (using the rb surrogate) of the adaptive_greedy algorithm.

To be more precise: It should be rb_adaptive_weak_greedy but since rb implies weak I removed that part.

@ftalbrecht
Copy link
Member

@ftalbrecht ftalbrecht commented Sep 10, 2019

To be more precise: It should be rb_adaptive_weak_greedy but since rb implies weak I removed that part.

Makes sense

@sdrave sdrave merged commit c1f8f94 into master Sep 10, 2019
7 checks passed
@sdrave sdrave deleted the weak_greedy branch Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants