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).