if __name__ == '__main__':

    from smc_sampler_functions.functions_smc_main import repeat_sampling
    samplers_list_dict_adaptive = [hmcdict_ft_adaptive, hmcdict_ours_adaptive, rwdict, maladict]

    # define the target distributions
    from smc_sampler_functions.target_distributions import priorlogdens, priorgradlogdens, priorsampler
    from smc_sampler_functions.target_distributions import targetlogdens_logistic, targetgradlogdens_logistic, f_dict_logistic_regression
    from smc_sampler_functions.target_distributions import targetlogdens_probit, targetgradlogdens_probit


    priordistribution = {'logdensity' : priorlogdens, 'gradlogdensity' : priorgradlogdens, 'priorsampler': priorsampler}
    targetdistribution = {'logdensity' : targetlogdens_logistic, 'gradlogdensity' : targetgradlogdens_logistic, 'target_name': 'logistic'}

    parameters_logistic = f_dict_logistic_regression(dim)
    parameters.update(parameters_logistic)

    target_dist_list = [targetdistribution]
    for target_dist in target_dist_list: 
        temperedist = sequence_distributions(parameters, priordistribution, target_dist)
        res_repeated_sampling_adaptive, res_first_iteration_adaptive = repeat_sampling(samplers_list_dict_adaptive, temperedist,  parameters, M_num_repetions=M_num_repetions, save_res=True, save_res_intermediate=False, save_name = target_dist['target_name'])

        

        #import ipdb; ipdb.set_trace()
        plt.show()
        # mean
        print(mh_sampler['particles'][0, 0, int(T_time / 2):].mean())
        # acceptance rate
        print(
            np.mean(
                np.diff(mh_sampler['particles'][0, 1,
                                                int(T_time / 2):], 1) > 0))
        plt.hist(mh_sampler['particles'][0, 1, int(T_time / 2):])
        plt.show()

        import ipdb
        ipdb.set_trace()

    from smc_sampler_functions.functions_smc_main import repeat_sampling
    #samplers_list_dict = [rwdict, hmcdict2, maladict, rwdict]
    samplers_list_dict = [hmcdict2, rwdict, maladict]
    #samplers_list_dict = [hmcdict1, hmcdict2]
    res_repeated_sampling, res_first_iteration = repeat_sampling(
        samplers_list_dict,
        temperedist,
        parameters,
        M_num_repetions=M_num_repetions,
        save_res=True,
        save_name=targetdistribution['target_name'])
    from smc_sampler_functions.functions_smc_plotting import plot_repeated_simulations, plot_results_single_simulation
    plot_repeated_simulations(res_repeated_sampling)
    plot_results_single_simulation(res_first_iteration)
    import ipdb
    ipdb.set_trace()