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
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.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()