您是否尝试过使用save_state
andrestore_sampler_state
方法?它们应该适用于任何非sqlite 后端(例如pickle、txt)。前者应将采样器信息保存到数据库中;这是一个例子:
{'stochastics': {'alpha': array([-0.20073951]), 'beta': array([ 2.77634734])}, 'step_methods': {'AdaptiveMetropolis_beta_alpha': {'C': array([[ 41.28628017, 2.79567393],
[ 2.79567393, 1.8832875 ]]), '_trace': [array([ 10.4010084 , 1.48321645]), ... [ 0.43509455, 1.30152996]]),
'accepted': 69.0, 'shrink_if_necessary': False}},
'sampler': {'status': 'ready', '_iter': 2000, '_tune_interval': 1000, '_tuned_count': 0, '_tune_throughout': True, '_burn_till_tuned': False, '_current_iter': 2000, '_burn': 0, '_thin': 1}}