-
Notifications
You must be signed in to change notification settings - Fork 44
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
SIRT objective #1790
base: master
Are you sure you want to change the base?
SIRT objective #1790
Changes from all commits
fa559d8
a6f37d3
6b2e404
4e751ae
6426c8b
1216d54
e3daef1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ class SIRT(Algorithm): | |
:math:`\mathrm{prox}_{C}` is the projection over a set :math:`C`, | ||
and :math:`\omega` is the relaxation parameter. | ||
|
||
Note that SIRT is equivalent to preconditioned gradient descent on a weighted least squares objective (weighted by :math:`M`) preconditioned by the sensitivity matrix (:math:`D`). | ||
Thus the objective calculation for SIRT is the weighted least squares objective :math:`\frac{1}{2}\|A x - b\|^{2}_{M}` where :math:`\|y\|_M^2:=y^TMy`. | ||
Parameters | ||
---------- | ||
|
||
|
@@ -106,6 +108,7 @@ def set_up(self, initial, operator, data, lower=None, upper=None, constraint=Non | |
self.data = data | ||
|
||
self.r = data.copy() | ||
|
||
|
||
self.constraint = constraint | ||
if constraint is None: | ||
|
@@ -201,9 +204,13 @@ def update(self): | |
self.x=self.constraint.proximal(self.x, tau=1) | ||
|
||
def update_objective(self): | ||
r"""Returns the objective | ||
r"""Returns the weighted least squares objective | ||
|
||
.. math:: \frac{1}{2}\|A x - b\|^{2} | ||
.. math:: \frac{1}{2}\|A x - b\|^{2}_{M} | ||
|
||
""" | ||
self.loss.append(0.5*self.r.squared_norm()) | ||
y = self.operator.direct(self.x) | ||
y.subtract(self.data, out = y) | ||
wy=self.M.multiply(y) | ||
self.objective.append(0.5* y.dot(wy)) | ||
Comment on lines
+212
to
+215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is adding an additional 2 copies of the data in to memory so we need to try to improve it.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried this but got numerical errors (effectively from dividing and multiplying by M). I will try to debug this again. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want the 0.5? Could be omitted for (slight) speed-up and objective function rewritten to omit this. Should think about consistency with defaults in related operations including LeastSquares and CGLS though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't a 0.5 in CGLS (it uses \min || A x - b ||^2_2) and the default for least squares is 1.0. So in some ways, SIRT would be odd to include the 0.5. Mathematically, it is optimising the same thing. Shall we remove it?