-
Notifications
You must be signed in to change notification settings - Fork 29
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
add accumulate_Hessian_times_input to STIR objective function and prior #1244
Comments
done for prior, @KrisThielemans please have a look at SIRF branch |
yes, this looks perfect to me. It'll be exactly the same for the Any ideas for a better name than "input"? somewhat in the vein of
For the log-likelihood with sinogram-data, the check could be to just do the explicit calculation:
(element-wise multiplications), where 0/0 is defined as 0 (in this case, which STIR will take care of). You can get a For the prior, this can be checked comparing the numerical second order derivative with the Hessian. This is done in STIR, see test_priors, so I don't see it's necessary to repeat that test here (especially as it was hard to get that to work with some priors due to numerical issues). Maybe it can be done for the quadratic prior only, as there the Hessian is constant (second derivative is constant), so numerical issues disappear. Main thing of course is if the wrapper works, so as long as we have a check that it doesn't fail, and it uses the same wrapping mechanism for the objective function and prior, I'd be happy to merge with the above check, a check for the quadratic prior that H*x is a multiple of x, but without numerical check for priors. |
Sorry, still lost in the dark...
|
@KrisThielemans @evgueni-ovtchinnikov If I am not completely wrong, I think
meaning the Hessian of the Poisson logL at the |
yes. sorry for the mistake! x=current_estimate is an image. H is a linear operation on x. We compute it on the fly with the above formula. |
Possible approach is to add similar lines for the loglikelihood already, push, then Georg can use it already, while you create the test. |
indeed. "Hessian applied" of Poisson logL (in sinogram mode) would be very helpful to advance the DL notebooks. And the same in listmode would be even better ;-) |
In
the following check:
and got
and if I set penalty factor to 0, I get
Looking at |
Oh I see, that formula must be for the objective function... |
For the quadratic prior, a not very strong check would be that that output doesn't depend on
which is different from what you have above. |
I've given the naming more thought. In fact, the I therefore think that in SIRF we need to have this in Python: ret = multiply_with_Hessian(current_estimate, image, optional_subset, out=optional) which should then call STIR's (schematically)
Obviously, we ideally we have this function on the C++ side as well, but I don't quite know (!) what our conventions are there. |
STIR has functionality to multiplying the Hessian with an image for priors and objective functions.
In STIR it's called
accumulate_Hessian_times_input
but "input" is a bit confusing (it does H . input), so suggestions welcome (@epapoutsellis @gschramm @Imraj-Singh @paskino).This would have to be added to
sirf.STIR.ObjectiveFunction
. I think the C++ version can be as-is, but the Python one should bewithout subset, it should do all of them I think (or at least, it should do the same as
gradient
).The text was updated successfully, but these errors were encountered: