def test_glass_posterior_log_pdf_execute():
    if not glass_available:
        raise SkipTest("Shogun not available")
    
    D = 9
    theta = np.random.randn(D)
    
    target = GlassPosterior()
    target.set_up()
    
    target.log_pdf(theta)
示例#2
0
def test_glass_posterior_log_pdf_execute():
    if not glass_available:
        raise SkipTest("Shogun not available")

    D = 9
    theta = np.random.randn(D)

    target = GlassPosterior()
    target.set_up()

    target.log_pdf(theta)
示例#3
0
def test_glass_posterior_setup_execute():
    if not glass_available:
        raise SkipTest("Shogun not available")

    GlassPosterior().set_up()
示例#4
0
               adaptation_schedule=schedule, acc_star=acc_star)

if __name__ == '__main__':
    """
    This example samples from the marginal posterior over hyper-parameters of a
    Gaussian Process classification model.
    
    All samplers in the paper are used.
    
    Note this is an illustrative demo and the number of iterations are set very low.
    """
    
    # Glass posterior has 9 dimensions
    D = 9
    if glass_available:
        target = GlassPosterior()
        target.set_up()
    else:
        target = IsotropicZeroMeanGaussian(D=D)

    # transition kernel, pick any
    samplers = [
                get_am_instance(target),
                get_mh_instance(target),
                get_kam_instance(target),
                get_kmc_instance(target)
               ]
    
    for sampler in samplers:
        
        # MCMC parameters