Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c5c594a
new version of adaptive PDHG
MargaretDuff Sep 19, 2025
b76e8e4
fix to the later paper
MargaretDuff Nov 14, 2025
c534930
Fixed some things but broke the backtracking on the 2015 paper
MargaretDuff Nov 17, 2025
e988dd2
Small update
MargaretDuff Dec 3, 2025
0804e72
Stashing to do something else
MargaretDuff Jan 29, 2026
e6a988d
Step size methods file now working?
MargaretDuff Feb 27, 2026
deab123
Merge remote-tracking branch 'upstream' into adaptive_pdhg
MargaretDuff Feb 27, 2026
6457d39
I think the two versions are now working as stepsize methods, next to…
MargaretDuff Feb 28, 2026
df6b7ed
Changed the step-size interface, currently failing PDHG convergence t…
MargaretDuff Mar 18, 2026
9f8ba21
PDHG fix found and all tests working
MargaretDuff Mar 19, 2026
d9cabcc
Constant step-size tests
MargaretDuff Mar 19, 2026
df98740
Backtracking tests
MargaretDuff Mar 19, 2026
79ee5a0
Added Bayesian parameter search
MargaretDuff Mar 20, 2026
4c81393
Updated bayesian optimisation to optimise over log(gamma), changed pr…
MargaretDuff Mar 25, 2026
fed220f
Remove deprecated code
lauramurgatroyd Apr 15, 2026
b74410f
fix test failures
lauramurgatroyd Apr 15, 2026
ed29601
handle max iterations
lauramurgatroyd Apr 15, 2026
55b3509
Fix progress test
lauramurgatroyd Apr 15, 2026
8c9734d
Fix some GD issues
lauramurgatroyd Apr 16, 2026
45d826b
Fix callbacks fail
lauramurgatroyd Apr 17, 2026
af97e32
Merge branch 'master' into remove_deprec_26
lauramurgatroyd Apr 24, 2026
6e2d637
Fix issue with CGLS iterating after fully converged on exact solution
lauramurgatroyd Apr 24, 2026
47b930a
Merge branch 'remove_deprec_26' of https://github.com/TomographicImag…
lauramurgatroyd Apr 24, 2026
4917a24
Add to Change log
lauramurgatroyd Apr 24, 2026
f28817c
Stash changes
MargaretDuff Apr 28, 2026
e1ca98e
Margaret's first pass, fixing failing test and deprecating a couple m…
MargaretDuff Apr 28, 2026
690ab46
White space changes
MargaretDuff Apr 28, 2026
0cde233
Removed deprecated code by merging in PR 2309
MargaretDuff Apr 28, 2026
3f21121
Added rosen with fixed stepsize test back
MargaretDuff Apr 28, 2026
82a3bf0
Actually added the test correctly (fingers crossed)
MargaretDuff Apr 28, 2026
6f4c74f
Update docs
lauramurgatroyd Apr 29, 2026
70cc5aa
Merge branch 'remove_deprec_26' of https://github.com/TomographicImag…
lauramurgatroyd Apr 29, 2026
1e9aa95
Update documentation
lauramurgatroyd Apr 29, 2026
0d16ade
Fix docs
lauramurgatroyd Apr 29, 2026
84b4bd5
fix docs
lauramurgatroyd Apr 29, 2026
e2097ab
Line spacing
lauramurgatroyd Apr 30, 2026
96b7e89
docs
lauramurgatroyd Apr 30, 2026
fe1487f
Removed Experimental Bayes Opt from this PR
MargaretDuff Apr 30, 2026
9ca2e31
Merge branch 'master' into remove_deprec_26
lauramurgatroyd Apr 30, 2026
b3ffb4b
Working on tests
MargaretDuff Apr 30, 2026
8acf541
Update Wrappers/Python/cil/optimisation/algorithms/FISTA.py
lauramurgatroyd May 6, 2026
17af2b1
Merge branch 'master' into remove_deprec_26
lauramurgatroyd May 8, 2026
bb1c7e2
Merge branch 'master' into remove_deprec_26
lauramurgatroyd May 15, 2026
bf85cd2
Updates to unit tests
MargaretDuff May 20, 2026
616c863
Merge remote-tracking branch 'upstream/remove_deprec_26' into adaptiv…
MargaretDuff May 20, 2026
794deef
Unit tests for adapative step sizes
MargaretDuff May 20, 2026
01723d5
First steps towards SPDHG - will take longer than I thought...
MargaretDuff May 20, 2026
71491fe
I think SPDHG constant step sizes working
MargaretDuff May 21, 2026
b78db55
SPDHG constant, ratio and Bayes step sizes and constant and ratio tests
MargaretDuff Jun 16, 2026
97b133e
SPDHG convergence test currently failing
MargaretDuff Jun 16, 2026
24fbbc3
Spdhg bayes convergence test
MargaretDuff Jun 22, 2026
9982fb1
Merge branch 'master' into adaptive_pdhg
MargaretDuff Jul 16, 2026
cfd3f78
Some refactoring and sorting of tests
MargaretDuff Jul 21, 2026
86e3060
documentation and checks for PDHG code
MargaretDuff Jul 22, 2026
156e9c3
draft spdhg adaptive
MargaretDuff Jul 22, 2026
7e45178
Bug fix to SPDHG Bayes and change in default value of eta for SPDHG b…
MargaretDuff Aug 12, 2026
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
3 changes: 1 addition & 2 deletions Wrappers/Python/cil/framework/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ def binary_operations(self, operation, other, *args, **kwargs):

# As axpyb cannot return anything we `continue` to skip the rest of the code block
continue

else:
raise ValueError('Unsupported operation', operation)
if out is not None:
Expand Down Expand Up @@ -600,7 +599,7 @@ def __div__(self, other):
# __rdiv__
def __truediv__(self, other):
return self.divide(other)

def __pow__(self, other):
return self.power(other)
# reverse operand
Expand Down
4 changes: 4 additions & 0 deletions Wrappers/Python/cil/framework/data_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ def divide(self, other, *args, **kwargs):
return _out
return self.pixel_wise_binary(numpy.divide, other, *args, **kwargs)



def power(self, other, *args, **kwargs):
return self.pixel_wise_binary(numpy.power, other, *args, **kwargs)

Expand All @@ -575,6 +577,8 @@ def maximum(self, x2, *args, **kwargs):

def minimum(self,x2, out=None, *args, **kwargs):
return self.pixel_wise_binary(numpy.minimum, x2=x2, out=out, *args, **kwargs)




def sapyb(self, a, y, b, out=None, num_threads=NUM_THREADS):
Expand Down
16 changes: 14 additions & 2 deletions Wrappers/Python/cil/optimisation/algorithms/Algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ def __init__(self, update_objective_interval=1):
self.update_objective_interval = update_objective_interval
self.iter_string = 'Iter'

def _reset_iteration_state(self):
'''Resets the iteration counter and the objective/iteration history.

This is intended for internal use by step-size rules that re-run the
algorithm during set-up (e.g. Bayesian optimisation of the step sizes),
so that they do not need to reach into the algorithm's private state.
'''
self.iteration = -1
self.__loss = []
self._iteration = []
self._total_iterations = 1

def set_up(self, *args, **kwargs):
'''Set up the algorithm'''
raise NotImplementedError
Expand Down Expand Up @@ -185,14 +197,14 @@ def loss(self):
@property
def update_objective_interval(self):
'''gets the update_objective_interval'''
return self.__update_objective_interval
return self._update_objective_interval

@update_objective_interval.setter
def update_objective_interval(self, value):
'''sets the update_objective_interval'''
if not isinstance(value, Integral) or value < 0:
raise ValueError('interval must be an integer >= 0')
self.__update_objective_interval = value
self._update_objective_interval = value

def run(self, iterations=None, callbacks: Optional[List[Callback]] = None, verbose=1):
r"""run upto :code:`iterations` with callbacks/logging.
Expand Down
6 changes: 2 additions & 4 deletions Wrappers/Python/cil/optimisation/algorithms/PD3O.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class PD3O(Algorithm):
Yan, M. A New Primal–Dual Algorithm for Minimizing the Sum of Three Functions with a Linear Operator. J Sci Comput 76, 1698–1717 (2018). https://doi.org/10.1007/s10915-018-0680-3
"""


def __init__(self, f, g, h, operator, delta=None, gamma=None, initial=None, **kwargs):

super(PD3O, self).__init__(**kwargs)
Expand All @@ -139,7 +138,8 @@ def set_up(self, f, g, h, operator, delta=None, gamma=None, initial=None,**kwarg
logging.info("{} setting up".format(self.__class__.__name__, ))

if isinstance(f, ZeroFunction):
warnings.warn(" If f is the ZeroFunction, then PD3O = PDHG. Please use PDHG instead. Otherwise, select a relatively small parameter gamma ", UserWarning)
warnings.warn(
" If f is the ZeroFunction, then PD3O = PDHG. Please use PDHG instead. Otherwise, select a relatively small parameter gamma ", UserWarning)
if gamma is None:
gamma = 1.0/operator.norm()

Expand Down Expand Up @@ -177,15 +177,13 @@ def set_up(self, f, g, h, operator, delta=None, gamma=None, initial=None,**kwarg
self.s_old.sapyb(1, self.s, self.delta, out=self.s_old)
self.h.proximal_conjugate(self.s_old, self.delta, out=self.s)


def update(self):
r""" Performs a single iteration of the PD3O algorithm
"""

# Following equations 4 in https://link.springer.com/article/10.1007/s10915-018-0680-3
# in this case order of proximal steps we recover the (primal) PDHG, when f=0


tmp = self.x_old
self.x_old = self.x
self.x = tmp
Expand Down
290 changes: 83 additions & 207 deletions Wrappers/Python/cil/optimisation/algorithms/PDHG.py

Large diffs are not rendered by default.

Loading
Loading