pub struct PreparedConditionedProgram { /* private fields */ }Expand description
One accepted-evidence exact circuit whose independent fact weights may change.
Clones share a single lock covering both host probability metadata and the device-resident weight tables. Evaluation and updates are therefore serialized for the same prepared circuit while unrelated circuits remain independent. If a failed device update cannot be rolled back, the shared circuit is permanently invalidated and every later operation through every clone fails.
Implementations§
Source§impl PreparedConditionedProgram
impl PreparedConditionedProgram
Sourcepub fn evaluate(&self) -> Result<(ExactResult, EpistemicProbProductionTrace)>
pub fn evaluate(&self) -> Result<(ExactResult, EpistemicProbProductionTrace)>
Evaluate the prepared conditioned circuit without recompiling it.
Sourcepub fn evaluate_with_grads(
&self,
) -> Result<(ExactResultWithGrads, EpistemicProbProductionTrace)>
pub fn evaluate_with_grads( &self, ) -> Result<(ExactResultWithGrads, EpistemicProbProductionTrace)>
Evaluate probabilities and gradients without recompiling the circuit.
Sourcepub fn prob_var_map(&self) -> Result<Vec<ProbVarInfo>>
pub fn prob_var_map(&self) -> Result<Vec<ProbVarInfo>>
Return the current CNF-variable metadata, including updated fact priors.
Sourcepub fn circuit_witness(&self) -> Result<ConditionedCircuitWitness>
pub fn circuit_witness(&self) -> Result<ConditionedCircuitWitness>
Return the immutable exact-state identity and lifetime preparation count.
Sourcepub fn set_fact_probabilities(&self, updates: &BTreeMap<u32, f64>) -> Result<()>
pub fn set_fact_probabilities(&self, updates: &BTreeMap<u32, f64>) -> Result<()>
Atomically update independent probabilistic fact weights.
A failed device write is rolled back before this returns. If that rollback also fails, the shared prepared circuit is permanently invalidated so that neither this handle nor any clone can observe potentially partial weights.
Trait Implementations§
Source§impl Clone for PreparedConditionedProgram
impl Clone for PreparedConditionedProgram
Source§fn clone(&self) -> PreparedConditionedProgram
fn clone(&self) -> PreparedConditionedProgram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more