I’ve got a turing model where there are a few parameters for each of a couple hundred objects, plus some structural parameters… so let’s call it close to 500 parameters.
I have a friend who has a simpler model (similar number of parameters, but expected to be less accurate but easier to fit) which fits in Stan, and he can get 100,000 samples in less than a couple minutes. (I told him it was crazy overkill but he figured why not, he’s doing thinning so he only stores 2000 or so but it’s like effective sample size of 2000). Turing with ReverseDiff using NUTS on my computer wants 2 hours to get 600 samples… I enabled the cache and now it wants 5-10 minutes to get 600 samples… this is still hundreds of times slower than Stan.
Are there general recommendations for getting decent speed in Julia/Turing?
my model loops through a dataset and is essentially doing a nonlinear regression.
for i in 1:Nrows
outcome[i] ~ Normal(somefunction(parameter1[data1[i]],parameter2[data2[i]],someextraparams),somescale)
end
somefunction is nonlinear and shape is determined by someextraparams.
parameter1 and parameter2 are vectors of a few hundred parameters and the data picks out which ones to use.
The vast majority of things i want to do Bayesian inference on fit in to this kind of framework: loop over a bunch of data, and learn a couple hundred to a couple thousand parameters…
The VAST majority of Turing example models I’ve seen are under 10 parameters. Is there some resource for those of us who are dealing with “BIG” models in Turing?