コード例 #1
0
ファイル: overall.py プロジェクト: jpmccoy/agg-as-inference
def eval_old_expts(expt, folder):
    pc = "mac"
    data_params = params.SeparateData()
    inference_params = params.StatesSeparateInference()
    data = wrapper.get_data(pc, expt, data_params)
    stats = diagnostics.get_world_stats_old_expt(folder)
    diagnostics.world_probs_vs_empirical(stats, 1, data, folder + 'new/')
コード例 #2
0
ファイル: overall.py プロジェクト: jpmccoy/agg-as-inference
def wrap_and_diagnose(pc, expt, data_params, inference_params, 
                      return_stats=False, expt_details='',
                      run_diagnostics=False, specified_start=None):
    assert inference_params.burnin <= inference_params.num_mh_question
    results_folder, log_folder = make_folders(expt, expt_details, 
                                              inference_params)
    print("Results saved in {0}".format(results_folder))
    results = mh_wrapper(pc, expt, data_params, inference_params, 
                         return_stats, results_folder, log_folder, 
                         specified_start)
    q_results, indiv_results, data = results
    if run_diagnostics:  #all_diagnostics contains lots of useful diagnostics
        diagnostics.save_stats_multiple_chains(q_results, data.qnames,  
                                               inference_params.num_chains,
                                               results_folder)
        diagnostics.world_probs_vs_empirical(q_results, 
                                             inference_params.num_chains, data, 
                                             results_folder)
        if indiv_results is not None:
            diagnostics.save_indiv_stats(indiv_results, data.subject_order, 
                                         results_folder)
    return q_results, indiv_results, data