Turing.jl
Turing.jl copied to clipboard
Allow user to provide a sampler to `optimize` in place of initial values
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.
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.