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

Allow user to provide a sampler to `optimize` in place of initial values

Open sethaxen opened this issue 3 years ago • 1 comments

Currently if a user doesn't provide an array of initial values to optimize, Turing generates the initial values using SampleFromPrior. However, perhaps the user wants to use SampleFromUniform or some other sampler instead. It would be handy if optimize would accept in that same place a sampler argument.

sethaxen avatar Feb 17 '22 10:02 sethaxen

There's really only two options here, either SampleFromPrior or SampleFromUniform, since all the other samples end up calling SampleFromPrior at the root.

But yeah, this would be a nice little addition, particularly for MLE, where you really don't want to be shoved into a region your prior heavily weights but your maximum likelihood estimate wants to be out of.

cpfiffer avatar Feb 17 '22 16:02 cpfiffer