- 
                Notifications
    You must be signed in to change notification settings 
- Fork 230
Description
Now that we have DynamicPPL.LogDensityFunction + AbstractMCMC.LogDensityModel, it would be nice to drop the usage of Turing.Inference.InferenceAlgorithm and allow "arbitrary" AbstractMCMC.AbstractSampler to be used with in Turing without much effort on the user side.
This would of course also help alleviate the discrepancy in configuration that is present on the package containing the implementation of the sampler and the corresponding "inference algorithm" in Turing.jl.
The issue with just replacing InferenceAlgorithm with AbstractSampler and AbstractMCMC.AbstractModel with DynamicPPL.Model, as is done in #2008, is that of method-ambiguities. I also assume that method ambiguities were part of the reason why InferenceAlgorithm was kept around.
There are, as I see it, two solutions:
- Replace the currently present overloads of AbstractMCMC.samplein Turing.jl by Turing's ownsample, i.e. makeTuring.sample !== AbstractMCMC.sample.Turing.samplethen callsAbstractMCMC.sampleunder the hood but with some additional niceties.
- Keep something equivalent to InferenceAlgorithmor a wrapper type and continue overloadingAbstractMCMC.sample.
Personally, I'm very much in favour of option (1). This has several benefits:
- Removes the type-piracy.
- Maintains the status-quo.