From 0f9f8e83827c5d0307e202ec97bd5cd7464d22ef Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Fri, 26 Aug 2022 06:51:26 -0600 Subject: [PATCH 1/3] Docs fixes --- scico/optimize/_admm.py | 5 ++++- scico/optimize/_ladmm.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scico/optimize/_admm.py b/scico/optimize/_admm.py index 5a0a86e81..a9ce21083 100644 --- a/scico/optimize/_admm.py +++ b/scico/optimize/_admm.py @@ -306,7 +306,10 @@ def u_init(self, x0: Union[JaxArray, BlockArray]) -> List[Union[JaxArray, BlockA Initialized to .. math:: - \mb{u}_i = C_i \mb{x}^{(0)} \;. + \mb{u}_i = \mb{0} \;. + + Note that the parameter `x0` is unused, but is provided for + potential use in an overridden method. Args: x0: Initial value of :math:`\mb{x}`. diff --git a/scico/optimize/_ladmm.py b/scico/optimize/_ladmm.py index a2d71fafd..34986f7bd 100644 --- a/scico/optimize/_ladmm.py +++ b/scico/optimize/_ladmm.py @@ -262,8 +262,10 @@ def u_init(self, x0: Union[JaxArray, BlockArray]) -> Union[JaxArray, BlockArray] Initialized to .. math:: - \mb{u} = C \mb{x}^{(0)} \;. + \mb{u} = \mb{0} \;. + Note that the parameter `x0` is unused, but is provided for + potential use in an overridden method. Args: x0: Starting point for :math:`\mb{x}`. From 85cd21f62e46e586fee765494297b539f38b126b Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Mon, 29 Aug 2022 13:21:01 -0600 Subject: [PATCH 2/3] Minor docs fix --- scico/optimize/_admm.py | 4 ++-- scico/optimize/_ladmm.py | 4 ++-- scico/optimize/_primaldual.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scico/optimize/_admm.py b/scico/optimize/_admm.py index a9ce21083..290bb17dd 100644 --- a/scico/optimize/_admm.py +++ b/scico/optimize/_admm.py @@ -222,7 +222,7 @@ def objective( :code:`self.z_list`. Returns: - scalar: Current value of the objective function. + scalar: Value of the objective function. """ if (x is None) != (z_list is None): raise ValueError("Both or neither of x and z_list must be supplied") @@ -252,7 +252,7 @@ def norm_primal_residual(self, x: Optional[Union[JaxArray, BlockArray]] = None) current iterate :code:`self.x`. Returns: - Current value of primal residual. + Value of primal residual. """ if x is None: x = self.x diff --git a/scico/optimize/_ladmm.py b/scico/optimize/_ladmm.py index 34986f7bd..0f4fb1bdd 100644 --- a/scico/optimize/_ladmm.py +++ b/scico/optimize/_ladmm.py @@ -190,7 +190,7 @@ def objective( iterate :code:`self.z`. Returns: - scalar: Current value of the objective function. + scalar: Value of the objective function. """ if (x is None) != (z is None): raise ValueError("Both or neither of x and z must be supplied") @@ -217,7 +217,7 @@ def norm_primal_residual(self, x: Optional[Union[JaxArray, BlockArray]] = None) :code:`self.x`. Returns: - Current value of primal residual. + Value of primal residual. """ if x is None: x = self.x diff --git a/scico/optimize/_primaldual.py b/scico/optimize/_primaldual.py index 9c4f94eec..3fb6c4057 100644 --- a/scico/optimize/_primaldual.py +++ b/scico/optimize/_primaldual.py @@ -204,7 +204,7 @@ def objective( :code:`self.x` Returns: - scalar: Current value of the objective function. + scalar: Value of the objective function. """ if x is None: x = self.x From 389c0b0f212e4a484896aa2984754c89b444fd96 Mon Sep 17 00:00:00 2001 From: Brendt Wohlberg Date: Tue, 30 Aug 2022 23:22:45 -0600 Subject: [PATCH 3/3] Correct misleading phrasing --- scico/optimize/_admm.py | 4 ++-- scico/optimize/_ladmm.py | 4 ++-- scico/optimize/_primaldual.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scico/optimize/_admm.py b/scico/optimize/_admm.py index 290bb17dd..7409b94f9 100644 --- a/scico/optimize/_admm.py +++ b/scico/optimize/_admm.py @@ -252,7 +252,7 @@ def norm_primal_residual(self, x: Optional[Union[JaxArray, BlockArray]] = None) current iterate :code:`self.x`. Returns: - Value of primal residual. + Norm of primal residual. """ if x is None: x = self.x @@ -272,7 +272,7 @@ def norm_dual_residual(self) -> float: \mb{z}^{(k-1)}_i}_2^2\right)^{1/2} \;. Returns: - Current value of dual residual. + Current norm of dual residual. """ out = 0.0 diff --git a/scico/optimize/_ladmm.py b/scico/optimize/_ladmm.py index 0f4fb1bdd..5c52fed1b 100644 --- a/scico/optimize/_ladmm.py +++ b/scico/optimize/_ladmm.py @@ -217,7 +217,7 @@ def norm_primal_residual(self, x: Optional[Union[JaxArray, BlockArray]] = None) :code:`self.x`. Returns: - Value of primal residual. + Norm of primal residual. """ if x is None: x = self.x @@ -233,7 +233,7 @@ def norm_dual_residual(self) -> float: \norm{\mb{z}^{(k)} - \mb{z}^{(k-1)}}_2 \;. Returns: - Current value of dual residual. + Current norm of dual residual. """ return norm(self.C.adj(self.z - self.z_old)) diff --git a/scico/optimize/_primaldual.py b/scico/optimize/_primaldual.py index 3fb6c4057..244788ccd 100644 --- a/scico/optimize/_primaldual.py +++ b/scico/optimize/_primaldual.py @@ -220,7 +220,7 @@ def norm_primal_residual(self) -> float: \tau^{-1} \norm{\mb{x}^{(k)} - \mb{x}^{(k-1)}}_2 \;. Returns: - Current value of primal residual. + Current norm of primal residual. """ return norm(self.x - self.x_old) / self.tau # type: ignore @@ -234,7 +234,7 @@ def norm_dual_residual(self) -> float: \sigma^{-1} \norm{\mb{z}^{(k)} - \mb{z}^{(k-1)}}_2 \;. Returns: - Current value of dual residual. + Current norm of dual residual. """ return norm(self.z - self.z_old) / self.sigma