Priors
gpplus.priors.horseshoe.LogHalfHorseshoePrior
¤
Bases: Prior
Prior for the log-noise variance hyperparameter for Gaussian Processes (GPs).
This prior is parameterized by scale and lb. The lb parameter defines the lower bound
on the noise variance, while scale is the key parameter influencing the prior. The default
value of scale (0.01) works well in deterministic and low-noise scenarios. In noisier situations
or with small training datasets, a larger scale value may be required, as it implies a higher
level of noise in the data.
To update the scale parameter of this prior for a model to 0.1, use the following code:
>>> model.likelihood.register(
>>> 'noise_prior', LogHalfHorseshoePrior(0.1, model.likelihood.noise_prior.lb),
>>> 'raw_noise'
>>> )
Note
- The
log_probmethod is approximate and unnormalized. There is no closed-form expression for the underlying horseshoe distribution. However, the lower and upper bounds on its density are known. This implementation uses the same approximate density value as the Spearmint package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scale
|
float or Tensor
|
Scale parameter of the horseshoe distribution. |
required |
lb
|
float or Tensor
|
Lower bound on the original scale. Defaults to 1e-6. |
1e-06
|
Source code in gpplus/priors/horseshoe.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
arg_constraints = {'scale': constraints.positive, 'lb': constraints.positive}
class-attribute
instance-attribute
¤
support = constraints.real
class-attribute
instance-attribute
¤
__init__(scale, lb=1e-06, validate_args=None)
¤
Source code in gpplus/priors/horseshoe.py
39 40 41 42 43 44 45 | |
transform(x)
¤
Source code in gpplus/priors/horseshoe.py
47 48 | |
log_prob(X)
¤
Source code in gpplus/priors/horseshoe.py
50 51 52 53 | |
rsample(sample_shape=torch.Size([]))
¤
Source code in gpplus/priors/horseshoe.py
55 56 57 58 59 60 61 62 | |
expand(expand_shape, _instance=None)
¤
Source code in gpplus/priors/horseshoe.py
64 65 66 | |