Skip to content

Commit 5d569dc

Browse files
authored
Sirt documentation improvements (#1959)
1 parent 69391bb commit 5d569dc

File tree

1 file changed

+16
-16
lines changed
  • Wrappers/Python/cil/optimisation/algorithms

1 file changed

+16
-16
lines changed

Wrappers/Python/cil/optimisation/algorithms/SIRT.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,22 @@
2727

2828

2929
class SIRT(Algorithm):
30-
3130
r"""Simultaneous Iterative Reconstruction Technique, see :cite:`Kak2001`.
3231
3332
Simultaneous Iterative Reconstruction Technique (SIRT) solves
3433
the following problem
3534
3635
.. math:: A x = b
3736
38-
The SIRT algorithm is
37+
The SIRT update step for iteration :math:`k` is given by
3938
40-
.. math:: x^{k+1} = \mathrm{proj}_{C}( x^{k} + \omega * D ( A^{T} ( M * (b - Ax^{k}) ) ) ),
39+
.. math:: x^{k+1} = \mathrm{proj}_{C}( x^{k} + \omega D ( A^{T} ( M (b - Ax^{k}) ) ) ),
4140
4241
where,
43-
:math:`M = \frac{1}{A*\mathbb{1}}`,
42+
:math:`M = \frac{1}{A\mathbb{1}}`,
4443
:math:`D = \frac{1}{A^{T}\mathbb{1}}`,
4544
:math:`\mathbb{1}` is a :code:`DataContainer` of ones,
46-
:math:`\mathrm{prox}_{C}` is the projection over a set :math:`C`,
45+
:math:`\mathrm{proj}_{C}` is the projection over a set :math:`C`,
4746
and :math:`\omega` is the relaxation parameter.
4847
4948
Parameters
@@ -63,9 +62,6 @@ class SIRT(Algorithm):
6362
A function with :code:`proximal` method, e.g., :class:`.IndicatorBox` function and :meth:`.IndicatorBox.proximal`,
6463
or :class:`.TotalVariation` function and :meth:`.TotalVariation.proximal`.
6564
66-
kwargs:
67-
Keyword arguments used from the base class :class:`.Algorithm`.
68-
6965
Note
7066
----
7167
If :code:`constraint` is not passed, :code:`lower` and :code:`upper` are used to create an :class:`.IndicatorBox` and apply its :code:`proximal`.
@@ -77,21 +73,22 @@ class SIRT(Algorithm):
7773
7874
The preconditioning arrays (weights) :code:`M` and :code:`D` used in SIRT are defined as
7975
80-
.. math:: M = \frac{1}{A*\mathbb{1}} = \frac{1}{\sum_{j}a_{i,j}}
81-
82-
.. math:: D = \frac{1}{A*\mathbb{1}} = \frac{1}{\sum_{i}a_{i,j}}
76+
.. math:: M = \frac{1}{A\mathbb{1}}
77+
78+
.. math:: D = \frac{1}{A^T\mathbb{1}}
8379
8480
8581
Examples
8682
--------
87-
.. math:: \underset{x}{\mathrm{argmin}} \frac{1}{2}\| x - d\|^{2}
83+
.. math:: \underset{x}{\mathrm{argmin}} \frac{1}{2}\| Ax - d\|^{2}
8884
89-
>>> sirt = SIRT(initial = ig.allocate(0), operator = A, data = d, max_iteration = 5)
85+
>>> sirt = SIRT(initial = ig.allocate(0), operator = A, data = d)
9086
9187
"""
9288

9389

9490
def __init__(self, initial=None, operator=None, data=None, lower=None, upper=None, constraint=None, **kwargs):
91+
"""Constructor of SIRT algorithm"""
9592

9693
super(SIRT, self).__init__(**kwargs)
9794

@@ -140,10 +137,12 @@ def set_up(self, initial, operator, data, lower=None, upper=None, constraint=Non
140137

141138
@property
142139
def relaxation_parameter(self):
140+
"""Get the relaxation parameter :math:`\omega`"""
143141
return self._relaxation_parameter
144142

145143
@property
146144
def D(self):
145+
"""Get the preconditioning array :math:`D`"""
147146
return self._Dscaled / self._relaxation_parameter
148147

149148
def set_relaxation_parameter(self, value=1.0):
@@ -164,6 +163,7 @@ def set_relaxation_parameter(self, value=1.0):
164163

165164

166165
def _set_up_weights(self):
166+
"""Set up the preconditioning arrays M and D"""
167167
self.M = 1./self.operator.direct(self.operator.domain_geometry().allocate(value=1.0))
168168
self._Dscaled = 1./self.operator.adjoint(self.operator.range_geometry().allocate(value=1.0))
169169

@@ -196,9 +196,9 @@ def _remove_nan_or_inf(self, datacontainer, replace_with=1.0):
196196

197197
def update(self):
198198

199-
r""" Performs a single iteration of the SIRT algorithm
199+
r""" Performs a single iteration of the SIRT algorithm. The update step for iteration :math:`k` is given by
200200
201-
.. math:: x^{k+1} = \mathrm{proj}_{C}( x^{k} + \omega * D ( A^{T} ( M * (b - Ax) ) ) )
201+
.. math:: x^{k+1} = \mathrm{proj}_{C}( x^{k} + \omega D ( A^{T} ( M (b - Ax^{k}) ) ) )
202202
203203
"""
204204

@@ -218,7 +218,7 @@ def update(self):
218218
self.x=self.constraint.proximal(self.x, tau=1)
219219

220220
def update_objective(self):
221-
r"""Returns the objective
221+
r""" Appends the current objective value to the list of previous objective values
222222
223223
.. math:: \frac{1}{2}\|A x - b\|^{2}
224224

0 commit comments

Comments
 (0)