Types API¶
deepuq.types contains the shared container types used across the UQ APIs. The most important one is UQResult, which gives every predict_uq(...) helper a common return shape.
UQResult at a glance¶
| Field | Type | Meaning |
|---|---|---|
mean | torch.Tensor | predictive mean; for classifiers this often mirrors probs |
epistemic_var | torch.Tensor \| None | uncertainty due to model/posterior uncertainty |
aleatoric_var | torch.Tensor \| None | uncertainty due to observation noise |
total_var | torch.Tensor \| None | total predictive variance |
probs | torch.Tensor \| None | predictive class probabilities |
probs_var | torch.Tensor \| None | probability-space disagreement/variance |
metadata | dict[str, Any] | backend, sample-count, or likelihood metadata |
Usage notes¶
- Regression methods should treat
meanas the primary prediction and populate variance fields where available. - Classification methods should prefer
probsandprobs_var;meanmay mirrorprobsfor convenience. metadatais intentionally open-ended. Use it for non-tensor method details such asn_members,n_mc,likelihood, orhessian_structure.
Related docs¶
deepuq.types ¶
Shared public types for Deep-UQ outputs.
UQResult dataclass ¶
Standardized uncertainty output container.
Fields are method-agnostic and can be partially populated depending on the inference algorithm and task type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean | Tensor | Predictive mean tensor for regression-style outputs. For classification methods this usually stores the same value as | required |
epistemic_var | Tensor | None | Variance attributed to model or posterior uncertainty. Present for methods that expose between-sample or between-model spread. | None |
aleatoric_var | Tensor | None | Variance attributed to data noise or likelihood noise. Present only for methods that model observation noise explicitly. | None |
total_var | Tensor | None | Total predictive variance. When both epistemic and aleatoric terms are available this should be their sum. | None |
probs | Tensor | None | Predictive class probabilities for classification methods. | None |
probs_var | Tensor | None | Probability-space variance or disagreement summary for classification methods. | None |
metadata | dict[str, Any] | Free-form method metadata such as backend, sample count, or likelihood settings. | dict() |