gpytorch icon indicating copy to clipboard operation
gpytorch copied to clipboard

[Feature Request] HalfNormal Prior

Open feynmanliang opened this issue 3 years ago • 2 comments

🚀 Feature Request

We would like to use the half normal (ie truncated Normal) available in pytorch at dist.half_normal.HalfNormal as a prior distribution for fully Bayesian GP inference.

One caveat is that it seems like the recipe in torch_priors.py only works on pyro.distributions.HalfNormal...

Motivation

We use a HalfNormal prior in an existing production model and would like to replicate numerics with gpytorch.

Pitch

Describe the solution you'd like

self.register_prior('half_normal_param_prior', HalfNormalPrior(float_value_for_halfnormal_scale), 'half_normal_param')

Are you willing to open a pull request? (We LOVE contributions!!!)

Yes. Actually, @ZitongZhou and I already have some internal workaronds.

feynmanliang avatar Sep 26 '22 23:09 feynmanliang

Sounds good! We'd happily accept a PR for this. What are the workarounds that are required?

gpleiss avatar Sep 27 '22 13:09 gpleiss

Hi Geoff, I worked with Feynman and opened a PR for this issue to add HalfNormal prior. #2147

ZitongZhou avatar Sep 27 '22 19:09 ZitongZhou