probcomp / Venturecxx

Primary implementation of the Venture probabilistic programming system
http://probcomp.csail.mit.edu/venture/
GNU General Public License v3.0
28 stars 6 forks source link

New SPs for log-odds-space Beta/Bernoulli. #619

Closed riastradh-probcomp closed 8 years ago

riastradh-probcomp commented 8 years ago
(log_odds_uniform) = (logit (uniform_continuous 0 1)) = (log_odds_beta 1 1)
(log_odds_beta a b) = (logit (beta a b))
(log_odds_bernoulli x) = (bernoulli (logistic x))
(log_odds_flip x) = (flip (logistic x))

On top of #618, finishes resolution for issue in https://github.com/probcomp/Venturecxx/issues/606 where Beta samples get rounded to 0 or 1 causing apparently impossible Bernoulli assessments later on to crash. Enables gradient-safe uniform and beta SPs, and anything derived from them like exponential, by providing primitive SPs supported on unbounded domains.