pub struct EpistemicEvalResult {
pub atoms: Vec<String>,
pub prob: Py<PyAny>,
pub log_prob: Py<PyAny>,
pub log_z_e: f64,
pub trace: Py<PyAny>,
}Expand description
Exact probabilities conditioned on an accepted epistemic world view.
prob/log_prob are DLPack capsules over device memory, like EvalResult.
trace carries the production-path counters of the epistemic->probability
adapter: they are the evidence that conditioning actually happened on the GPU.
log_z_e is log P(evidence): the exact log-probability of the conditioned
evidence under the probabilistic program’s distribution, computed by weighted
model counting over the compiled circuit. Query probabilities are
exp(log_z_eq - log_z_e). When the conditioned atoms are independent root
facts it coincides with the log of the product of their priors, but that is a
special case, not the definition: evidence on a derived atom, on atoms sharing
an ancestor, or negated evidence all diverge from the product form.
Fields§
§atoms: Vec<String>§prob: Py<PyAny>§log_prob: Py<PyAny>§log_z_e: f64§trace: Py<PyAny>Trait Implementations§
impl DerefToPyAny for EpistemicEvalResult
impl ExtractPyClassWithClone for EpistemicEvalResult
Source§impl<'py> IntoPyObject<'py> for EpistemicEvalResult
impl<'py> IntoPyObject<'py> for EpistemicEvalResult
Source§type Target = EpistemicEvalResult
type Target = EpistemicEvalResult
Source§type Output = Bound<'py, <EpistemicEvalResult as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <EpistemicEvalResult as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for EpistemicEvalResult
impl PyClass for EpistemicEvalResult
Source§impl PyClassImpl for EpistemicEvalResult
impl PyClassImpl for EpistemicEvalResult
Source§const MODULE: Option<&str> = ::core::option::Option::None
const MODULE: Option<&str> = ::core::option::Option::None
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// an ancestor, or negated evidence all diverge from the product form.
const RAW_DOC: &'static CStr = /// an ancestor, or negated evidence all diverge from the product form.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<EpistemicEvalResult as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<EpistemicEvalResult>
type Layout = <<EpistemicEvalResult as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<EpistemicEvalResult>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForEpistemicEvalResult
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
§fn dict_offset() -> Option<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyTypeInfo for EpistemicEvalResult
impl PyTypeInfo for EpistemicEvalResult
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.Auto Trait Implementations§
impl !RefUnwindSafe for EpistemicEvalResult
impl Freeze for EpistemicEvalResult
impl Send for EpistemicEvalResult
impl Sync for EpistemicEvalResult
impl Unpin for EpistemicEvalResult
impl UnsafeUnpin for EpistemicEvalResult
impl UnwindSafe for EpistemicEvalResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more