-
Notifications
You must be signed in to change notification settings - Fork 95
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
Priors/Hessian method corrections #901
Priors/Hessian method corrections #901
Conversation
These latest commits do not fix a possible mistake with the RDP's |
…sian_concavity This is a change to keep consistency with changes in UCL#901
Implemented I have rewritten Added Added
Regarding testing:
|
Currently This is because of an inconsistancy between off-diagonal elements in the numerical-Hessian and the Hessian. The RDP is very sensitivie if I am fairly convinced that the implementation of the RDP's Hessian is correct and it is the test that is the issue. Edit: Interesting that one of the travis jobs actually passed on |
* Test PoissonLogLikelihoodWithLinearModelForMeanAndProjData Hessian * Do subtraction in accumulate_sub_Hessian_times_input for Poisson * Update Hessian_vector_product documentation and test error message * Rename test_objective_function_Hessian to test_objective_function_Hessian_concavity This is a change to keep consistency with changes in UCL#901
Create bools to toggle the use of various tests for different penalties. RDP with RDP_eps = 0 will likely allways fail the numerical Hessian test. |
Ready for review. There is overlap with #902. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments. I didn't check the tests yet
I have addressed all pertinent suggestions |
Future progress on this PR should include an intermediate class for the impacted priors. This class should handle the for loops for each of the Hessian methods and create the virtual functions for the |
* RDP accumulate_Hessian_times_input * Added RDP Hessian documentation * Add div by 0 safety * Add epsilon to Hessian function
Updates the math for the RDP
* RDP Documententation * QP use (off_)diagonal_second_derivative methods and documentation * Restructure RDP and QP Hessian logic * Improve RDP and QP documentation * Implement log cosh accumulate_Hessian_times_input in terms of derivatives * Documentation
* Add method get_is_convex(), which accesses prior is_convex parameter and only test convexity of priors if convex function * compute_Hessian method added to generalised prior and errors by default but with different messages depending on is_convex * Test rename and create test_Hessian_convexity and test_Hessian_methods * Add test for compute_Hessian * RelativeDifferencePrior initialisation call set_defaults * Modernise `compute_Hessian` for QP and LogCosh. Add `compute_Hessian` for RDP * Correct RDP second derivative functions * Major changes to test_Hessian_against_numerical, which loops over each voxel for perturbation response * Add verbosity suppression to suppress gradient info calls
Reenable PLS, but disable all numerical tests - just run setup.
Make is_convex() a pure virtual method in GeneralisedPrior to be implemented in each prior. FilterRoot is not convex as it does not have 0th or 2nd order behaviour
Co-authored-by: Kris Thielemans <KrisThielemans@users.noreply.github.com>
Co-authored-by: Kris Thielemans <KrisThielemans@users.noreply.github.com>
This removes two checks on Succeeded::no in GeneralisedObjectiveFunction
15aebe7
to
6596d29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to go, assuming the tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. One tiny comment. Also, can you add something to release_5.1.htm
? You probably will have to merge master
into here first to get that file.
…VectorProduct"" This reverts commit 3f0b210.
This PR was going to simply add the
accumulate_Hessian_times_input
method to the RDP but while implementing it it was discovered that the implementations in theQuadratic
andLogCosh
priors were also incorrect. Additionally improves priors testing (#153).This PR will attempt to do the following for each of the aforementioned priors:
accumulate_Hessian_times_input
to compute the correct Hessian vector productis_convex = false
to generalised prior. Setis_convex = true
for all convex priors.x^T Hx >0
compute_Hessian()
to all convex methodsgrad(x) - grad(x+eps) ~= H(x)
, where eps is a small perturbation.diagonal_second_derivative
andoff_diagonal_second_derivative
methods for use in all Hessian methodsRelative Difference Prior
accumulate_Hessian_times_input