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

Change svd call to avoid compute_uv=False #214

Merged
merged 2 commits into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scico/functional/_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ class NuclearNorm(Functional):
has_prox = True

def __call__(self, x: Union[JaxArray, BlockArray]) -> float:
return snp.sum(snp.linalg.svd(x, compute_uv=False))
# Set computute_uv=True to work around
# https://github.com/google/jax/issues/9483
_, s, _ = snp.linalg.svd(x, compute_uv=True)
return snp.sum(s)

def prox(
self, v: Union[JaxArray, BlockArray], lam: float = 1.0, **kwargs
Expand Down