Turing.jl icon indicating copy to clipboard operation
Turing.jl copied to clipboard

Reenable PriorContext for Optimization

Open alyst opened this issue 1 year ago • 3 comments

This PR reenables the support for PriorContext in optimization, which was disabled by #2022. While it is not directly supported by the current optim_problem() interface (only MLE/MAP are supported, although adding MaxPrior is possible), I think it is useful to support PriorContext for Turing.OptimLogDensity(). In my code I use it for multi-objective Pareto optimization (prior + llh).

alyst avatar Feb 03 '24 23:02 alyst

This PR reenables the support for PriorContext in optimization, which was disabled by #2022.

AFAICT support for PriorContext has never existed and has never been tested. The check in the PR was only introduced to communicate this more clearly and provide a better error message.

devmotion avatar Feb 03 '24 23:02 devmotion

AFAICT support for PriorContext has never existed and has never been tested.

I see. It was working before though. Do you think it makes sense to support it for some of the user use cases?

alyst avatar Feb 04 '24 00:02 alyst

IMO if we 're allowing both DefaultContext and LikelihoodContext, I feel like allowing PriorContext also seems reasonable (i.e. all the leaf-contexts).

torfjelde avatar Feb 04 '24 15:02 torfjelde

@mhauru I have incorporated your suggestions, thank you!

alyst avatar May 30 '24 02:05 alyst

Would be happy to include this:) But we need to fix the merge conflicts :confused:

torfjelde avatar Jun 04 '24 12:06 torfjelde

Pull Request Test Coverage Report for Build 9384233247

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • 89 unchanged lines in 1 file lost coverage.
  • Overall coverage remained the same at 0.0%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/optimisation/Optimisation.jl 0 5 0.0%
<!-- Total: 0 5
Files with Coverage Reduction New Missed Lines %
src/optimisation/Optimisation.jl 89 0.0%
<!-- Total: 89
Totals Coverage Status
Change from base Build 9374257750: 0.0%
Covered Lines: 0
Relevant Lines: 1503

💛 - Coveralls

coveralls avatar Jun 05 '24 14:06 coveralls

Thanks @alyst!

mhauru avatar Jun 05 '24 17:06 mhauru

Lovely work @alyst :)

torfjelde avatar Jun 06 '24 07:06 torfjelde