예제 #1
0
파일: env_priors.py 프로젝트: snpc94/RoBO
    def __init__(self, n_dims, n_ls, n_kt, rng=None):

        if rng is None:
            self.rng = np.random.RandomState(np.random.randint(0, 10000))
        else:
            self.rng = rng

        # The number of hyperparameters
        self.n_dims = n_dims

        # The number of lengthscales
        self.n_ls = n_ls

        # The number of entries of
        # kernel matrix for the tasks
        self.n_kt = n_kt

        # Prior for the Matern52 lengthscales
        self.tophat = TophatPrior(-10, 2, rng=self.rng)

        # Prior for the covariance amplitude
        self.ln_prior = LognormalPrior(mean=0.0, sigma=1.0, rng=self.rng)

        # Prior for the noise
        self.horseshoe = HorseshoePrior(scale=0.1, rng=self.rng)

        self.tophat_task = TophatPrior(-10, 2, rng=self.rng)
예제 #2
0
파일: env_priors.py 프로젝트: snpc94/RoBO
    def __init__(self, n_dims, n_ls, n_lr, rng=None):

        if rng is None:
            self.rng = np.random.RandomState(np.random.randint(0, 10000))
        else:
            self.rng = rng

        # The number of hyperparameters
        self.n_dims = n_dims

        # The number of lengthscales
        self.n_ls = n_ls

        # The number of params of the bayes linear reg kernel
        self.n_lr = n_lr
        self.bayes_lin_prior = NormalPrior(sigma=1, mean=0, rng=self.rng)

        # Prior for the Matern52 lengthscales
        self.tophat = TophatPrior(-10, 2, rng=self.rng)

        # Prior for the covariance amplitude
        self.ln_prior = LognormalPrior(mean=-2, sigma=1.0, rng=self.rng)

        # Prior for the noise
        self.horseshoe = HorseshoePrior(scale=0.001, rng=self.rng)
예제 #3
0
    def test(self):
        prior = LognormalPrior(sigma=0.1)

        # Check sampling
        p0 = prior.sample_from_prior(10)
        assert len(p0.shape) == 2
        assert p0.shape[0] == 10
        assert p0.shape[1] == 1
예제 #4
0
    def __init__(self, n_dims):

        # The number of hyperparameters
        self.n_dims = n_dims

        # Prior for the Matern52 lengthscales
        self.tophat = TophatPrior(-2, 2)

        # Prior for the covariance amplitude
        self.ln_prior = LognormalPrior(mean=0.0, sigma=1.0)

        # Prior for the noise
        self.horseshoe = HorseshoePrior(scale=0.1)
예제 #5
0
파일: env_priors.py 프로젝트: snpc94/RoBO
    def __init__(self, n_dims, n_ls, n_lr):

        # The number of hyperparameters
        self.n_dims = n_dims

        # The number of lengthscales
        self.n_ls = n_ls

        # The number of params of the bayes linear reg kernel
        self.n_lr = n_lr

        # Prior for the Matern52 lengthscales
        self.tophat = TophatPrior(-2, 2)

        # Prior for the covariance amplitude
        self.ln_prior = LognormalPrior(mean=0.0, sigma=1.0)

        # Prior for the noise
        self.horseshoe = HorseshoePrior(scale=0.1)
예제 #6
0
    def __init__(self, rng=None):
        """
        Abstract base class to define the interface for priors
        of GP hyperparameter.
        Parameters
        ----------

        """
        if rng is None:
            self.rng = np.random.RandomState(np.random.randint(0, 10000))
        else:
            self.rng = rng

        # Prior for the alpha
        self.ln_prior_alpha = LognormalPrior(sigma=0.1, mean=-10)

        # Prior for the sigma^2
        #self.ln_prior_beta = LognormalPrior(sigma=0.1, mean=2)
        self.horseshoe = HorseshoePrior(scale=0.1)
예제 #7
0
    def __init__(self, n_dims, n_ls, n_kt):

        # The number of hyperparameters
        self.n_dims = n_dims

        # The number of lengthscales
        self.n_ls = n_ls

        # The number of entries of
        # kernel matrix for the tasks
        self.n_kt = n_kt

        # Prior for the Matern52 lengthscales
        self.tophat = TophatPrior(-2, 2)

        # Prior for the covariance amplitude
        self.ln_prior = LognormalPrior(mean=0.0, sigma=1.0)

        # Prior for the noise
        self.horseshoe = HorseshoePrior(scale=0.1)

        self.tophat_task = TophatPrior(-2, 2)