macro_rules! prob {
($e:expr) => { ... };
(let $var:ident <- $expr:expr; $($rest:tt)*) => { ... };
(let $var:ident = $expr:expr; $($rest:tt)*) => { ... };
($expr:expr; $($rest:tt)*) => { ... };
}Expand description
Probabilistic programming macro, used to define probabilistic programs with do-notation.
Example:
let model = prob! {
let x <- sample(addr!("x"), Normal::new(0.0, 1.0).unwrap());
let y <- sample(addr!("y"), Normal::new(x, 1.0).unwrap());
pure(y)
};