pub enum ProbVarInfo {
Fact {
atom: GroundAtom,
prob: f64,
},
Choice {
choices: Arc<[(GroundAtom, f64)]>,
choice_index: usize,
prob: f64,
},
Other,
}Expand description
What a CNF variable stands for, in the order of the gradient vectors.
Variants§
Fact
A plain probabilistic fact: one atom, one probability. prob is
exactly the Bernoulli weight w_true stored in the GPU weight table
for this variable, so p*(1-p) is the correct Jacobian for
grad_true/grad_false at this slot.
Choice
One Bernoulli decision of an annotated disjunction’s chain.
Fields
choices: Arc<[(GroundAtom, f64)]>Declared heads of the whole disjunction with their marginal
probabilities (context/display only — see prob below for the
Jacobian-correct parameter of this specific chain variable).
prob: f64The conditional Bernoulli parameter actually assigned to this
CNF variable’s weight (p_i / (1 - sum of earlier heads' probabilities)), i.e. the same value stored in
provenance::Provenance::choice_probs and used to build the GPU
weight table for this variable. prob*(1-prob) — using this
prob, not choices[choice_index].1 — is the correct Jacobian
for grad_true/grad_false at this slot; the two are generally
different values.
Other
A variable introduced by compilation that is not a source of randomness.
Trait Implementations§
Source§impl Clone for ProbVarInfo
impl Clone for ProbVarInfo
Source§fn clone(&self) -> ProbVarInfo
fn clone(&self) -> ProbVarInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more