Turing.jl
Turing.jl copied to clipboard
Reenable PriorContext for Optimization
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).
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.
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?
IMO if we 're allowing both DefaultContext
and LikelihoodContext
, I feel like allowing PriorContext
also seems reasonable (i.e. all the leaf-contexts).
@mhauru I have incorporated your suggestions, thank you!
Would be happy to include this:) But we need to fix the merge conflicts :confused:
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 | |
---|---|
Change from base Build 9374257750: | 0.0% |
Covered Lines: | 0 |
Relevant Lines: | 1503 |
💛 - Coveralls
Thanks @alyst!
Lovely work @alyst :)