Esempio n. 1
0
 def get_StaticMetropolis_instance(D, target_log_pdf):
     step_size = 0.002
     instance = StaticMetropolis(D, target_log_pdf, step_size)
     
     # oracle scaling
     instance.L_C = np.linalg.cholesky(true_cov)
     
     return instance
Esempio n. 2
0
    def get_StaticMetropolis_instance(D, target_log_pdf):
        step_size = 0.002
        instance = StaticMetropolis(D, target_log_pdf, step_size)

        # oracle scaling
        instance.L_C = np.linalg.cholesky(true_cov)

        return instance
Esempio n. 3
0
 def __init__(self, D, target_log_pdf, n, kernel_sigma, step_size, gamma2=0.1, schedule=None, acc_star=0.234):
     
     StaticMetropolis.__init__(self, D, target_log_pdf, step_size, schedule, acc_star)
     
     self.n = n
     self.kernel_sigma = kernel_sigma
     self.gamma2 = gamma2
     
     self.Z = np.zeros((0, D))
Esempio n. 4
0
 def __init__(self, D, target_log_pdf, grad, step_size, schedule=None, acc_star=None):
     StaticMetropolis.__init__(self, D, target_log_pdf, step_size, schedule, acc_star)
     
     self.grad = grad
     
     # members hidden from constructor
     self.manual_gradient_step_size = None
     self.do_preconditioning = False
     
     self.forward_drift_norms = []
 def get_StaticMetropolis_instance(D, target_log_pdf):
     step_size = 0.002
     acc_star = None
     schedule = None
     instance = StaticMetropolis(D, target_log_pdf, step_size, schedule, acc_star)
     
     # give proposal variance a meaningful shape from previous samples
     benchmark_samples_fname = "pmc_sv_benchmark_samples.txt"
     benchmark_samples_sha1 = "d53e505730c41fbe413188530916d9a402e21a87"
     assert_file_has_sha1sum(benchmark_samples_fname, benchmark_samples_sha1)
     
     benchmark_samples = np.loadtxt(benchmark_samples_fname)
     benchmark_samples = benchmark_samples[np.arange(0, len(benchmark_samples), step=50)]
     instance.L_C = np.linalg.cholesky(np.cov(benchmark_samples.T))
     
     return instance
def get_StaticMetropolis_instance(D, target_log_pdf):
    
    step_size = 8.
    schedule = one_over_sqrt_t_schedule
    acc_star = 0.234
    instance = StaticMetropolis(D, target_log_pdf, step_size, schedule, acc_star)
    
    return instance
Esempio n. 7
0
    def __init__(self,
                 D,
                 target_log_pdf,
                 grad,
                 step_size,
                 schedule=None,
                 acc_star=None):
        StaticMetropolis.__init__(self, D, target_log_pdf, step_size, schedule,
                                  acc_star)

        self.grad = grad

        # members hidden from constructor
        self.manual_gradient_step_size = None
        self.do_preconditioning = False

        self.forward_drift_norms = []
Esempio n. 8
0
    def __init__(self,
                 D,
                 target_log_pdf,
                 n,
                 kernel_sigma,
                 step_size,
                 gamma2=0.1,
                 schedule=None,
                 acc_star=0.234):

        StaticMetropolis.__init__(self, D, target_log_pdf, step_size, schedule,
                                  acc_star)

        self.n = n
        self.kernel_sigma = kernel_sigma
        self.gamma2 = gamma2

        self.Z = np.zeros((0, D))
    def get_StaticMetropolis_instance(D, target_log_pdf):
        step_size = 0.002
        acc_star = None
        schedule = None
        instance = StaticMetropolis(D, target_log_pdf, step_size, schedule,
                                    acc_star)

        # give proposal variance a meaningful shape from previous samples
        benchmark_samples_fname = "pmc_sv_benchmark_samples.txt"
        benchmark_samples_sha1 = "d53e505730c41fbe413188530916d9a402e21a87"
        assert_file_has_sha1sum(benchmark_samples_fname,
                                benchmark_samples_sha1)

        benchmark_samples = np.loadtxt(benchmark_samples_fname)
        benchmark_samples = benchmark_samples[np.arange(0,
                                                        len(benchmark_samples),
                                                        step=50)]
        instance.L_C = np.linalg.cholesky(np.cov(benchmark_samples.T))

        return instance
Esempio n. 10
0
    def get_StaticMetropolis_instance(D, target_log_pdf):
        step_size = 1.
        instance = StaticMetropolis(D, target_log_pdf, step_size)

        return instance