-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Spelling error fix in docs * Add class representing a functional composed with an orthogonal linear operator * Add tests for ComposedFunctional * Improve docs and add __repr__ * Add entry in change summary * Resolve typing issue * Change error metric in tests * Update submodule
- Loading branch information
Showing
11 changed files
with
129 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule data
updated
4 files
+1 −1 | notebooks/ct_abel_tv_admm_tune.ipynb | |
+1 −1 | notebooks/deconv_tv_admm_tune.ipynb | |
+ − | pytest/durations_macos.bz2 | |
+ − | pytest/durations_ubuntu.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import numpy as np | ||
|
||
from jax import config | ||
|
||
from prox import prox_test | ||
|
||
from scico import functional, linop | ||
from scico.random import randn | ||
|
||
# enable 64-bit mode for output dtype checks | ||
config.update("jax_enable_x64", True) | ||
|
||
|
||
class TestComposed: | ||
def setup_method(self): | ||
key = None | ||
self.shape = (2, 3, 4) | ||
self.dtype = np.float32 | ||
self.x, key = randn(self.shape, key=key, dtype=self.dtype) | ||
self.composed = functional.ComposedFunctional( | ||
functional.L2Norm(), | ||
linop.Reshape(self.x.shape, (2, -1), input_dtype=self.dtype), | ||
) | ||
|
||
def test_eval(self): | ||
np.testing.assert_allclose(self.composed(self.x), self.composed.functional(self.x)) | ||
|
||
def test_prox(self): | ||
prox_test(self.x, self.composed.__call__, self.composed.prox, 1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters