CCS-Lab / hBayesDM

Hierarchical Bayesian modeling of RLDM tasks, using R & Python
https://ccs-lab.github.io/hBayesDM
GNU General Public License v3.0
223 stars 113 forks source link

Reusing compiled model objects #120

Open EoinTravers opened 4 years ago

EoinTravers commented 4 years ago

In rstan, it's possible to compile a model without providing any data or doing any sampling, and then use provide data and draw samples in a subsequent call; something like:

library(rstan)
empty_model = stan('my_model.stan', iter=0)
full_model = stan(fit=empty_model, data=my_data, iter=2000)

Would it be reasonable to do something similar here? This would mean that a) users could fit the model on multiple data sets without recompiling, and b) it wouldn't be necessary to recompile the model if a mistake was made providing the data.

Thanks.