[SyneRBI/SIRF-Contribs] LBFGSPC implementation and scipy callback vs CIL Algorithm callback (Issue #24)

4 views
Skip to first unread message

Kris Thielemans

unread,
Nov 3, 2025, 8:00:58 PM11/3/25
to SyneRBI/SIRF-Contribs, Subscribed
KrisThielemans created an issue (SyneRBI/SIRF-Contribs#24)

At present we call our own member method
https://github.com/SyneRBI/SIRF-Contribs/blob/32b052d8de2dee9549599cb7bba10451da64b74c/src/Python/sirf/contrib/LBFGSBPC/LBFGSBPC.py#L68-L75

https://github.com/SyneRBI/SIRF-Contribs/blob/32b052d8de2dee9549599cb7bba10451da64b74c/src/Python/sirf/contrib/LBFGSBPC/LBFGSBPC.py#L88

This works as SciPy callback expects the current estimate as argument
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fmin_l_bfgs_b.html

callback: callable, optional
Called after each iteration, as callback(xk), where xk is the current parameter vector.

On the other hand, CIL callbacks get the whole "algo" object as argument https://github.com/TomographicImaging/CIL/blob/956fe87aa45166dc3a85f1f02c9f03f27b7348e8/Wrappers/Python/cil/optimisation/algorithms/Algorithm.py#L283.

I'm not sure how to make the 2 compatible. Possibly we can have a method

def callback(self, x):
    for c in self.callbacks:
        c(self) # ignore the x argument

@paskino @casperdcl @MargaretDuff @gfardell ?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-Contribs/issues/24@github.com>

Kris Thielemans

unread,
Jan 25, 2026, 7:12:46 AMJan 25
to SyneRBI/SIRF-Contribs, Subscribed

Closed #24 as completed via #27.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <SyneRBI/SIRF-Contribs/issue/24/issue_event/22273588038@github.com>

Reply all
Reply to author
Forward
0 new messages