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

Add function to compute operator norm #79

Merged
merged 2 commits into from
Nov 10, 2021
Merged

Add function to compute operator norm #79

merged 2 commits into from
Nov 10, 2021

Conversation

bwohlberg
Copy link
Collaborator

Add function to compute operator norm.

@bwohlberg bwohlberg added the enhancement New feature or request label Nov 9, 2021
@codecov
Copy link

codecov bot commented Nov 9, 2021

Codecov Report

Merging #79 (52b34bf) into main (3852542) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   89.12%   89.16%   +0.04%     
==========================================
  Files          43       43              
  Lines        2978     2980       +2     
==========================================
+ Hits         2654     2657       +3     
+ Misses        324      323       -1     
Flag Coverage Δ
unittests 89.16% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
scico/linop/__init__.py 100.00% <100.00%> (ø)
scico/linop/_linop.py 96.00% <100.00%> (+1.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3852542...52b34bf. Read the comment docs.

@@ -58,6 +57,40 @@ def power_iteration(A: LinearOperator, maxiter: int = 100, key: Optional[PRNGKey
return mu, v


def operator_norm(A: LinearOperator, maxiter: int = 100, key: Optional[PRNGKey] = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea: it might be convenient to also have a norm property on LinearOperators that can be set during construction if it is easy to compute. Circulant convolutions come to mind. Then optimizers that want the norm can see if A.norm is not None before running the potentially expensive power iteration.

Copy link
Contributor

@Michael-T-McCann Michael-T-McCann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to merge, my comment not meant as a blocker

@bwohlberg bwohlberg merged commit dbee22a into main Nov 10, 2021
@bwohlberg bwohlberg deleted the brendt/linop-norm branch November 10, 2021 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants