Skip to content
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

Generalisation of Priors class #694

Open
robbietuk opened this issue Sep 22, 2020 · 2 comments
Open

Generalisation of Priors class #694

robbietuk opened this issue Sep 22, 2020 · 2 comments

Comments

@robbietuk
Copy link
Collaborator

robbietuk commented Sep 22, 2020

There is a lot of code duplication for each of the priors. The priors implemented right now are:

  • Quadratic
  • Relative Difference Prior
  • Parallel Level Sets
  • FilterRoot
  • LogCosh

There are additional priors that could easily be added:

  • Huber
  • Bowsher

Each of these priors has its own iterator of the computation of value and gradient and generally act over a local neighbourhood.
All priors (except FilterRoot) an implementation of the usage of the spatially variable penalty strength (kappa).
There are a selection of priors (i.e. QP, logcosh, hubber) can utilise parabolic_surrogate_curvature.

It seems that a lot of this functionality should belong in Generalised Prior (https://github.com/UCL/STIR/blob/master/src/recon_buildblock/GeneralisedPrior.cxx) or more likely an intermediary class, e.g. Gibbs prior that contains all the common methods, such as an iterator for the function and the gradient.

This issue is just to note some ideas regarding the generalisation of the priors.

@robbietuk
Copy link
Collaborator Author

#662 (Unable to set/get prior kappa image from STIR-python (matlab)) and #707 (STIR-python OSMAPOSL priors are GeneralisedPrior objects rather than child class priors) are related to this.

@robbietuk robbietuk mentioned this issue Dec 18, 2020
3 tasks
@robbietuk
Copy link
Collaborator Author

In light of #901, I am more so inclinded to add an intermediate class, i.e. Gibbs prior, that the Quadratic, Relative Difference Prior, Parallel Level Sets, LogCosh, and (Huber + Bowsher) are child classes of. This class should contain not only iterators but virtual functions for gradients and Hessian second derivitives. Each of the classes can then override those functions.

In #901 I have begun to add off_diagonal_second_derivative and diagonal_second_derivative methods, which will make accumulate_Hessian_times_input for QP, logcosh and RDP 100% code duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant