NaturalPosteriorDecomposition¶
- class probly.method.natural_posterior_network.NaturalPosteriorDecomposition(distribution: SecondOrderDistributionLike, base: LogBase = None)[source]¶
Bases:
CachingDecomposition,AleatoricEpistemicTotalDecomposition,GenericDecomposition based on the Natural Posterior Network.
Implements the three uncertainty quantities formally proposed by NatPN [CBZugner+22] in Appendix E (“Formulae for Uncertainty Estimates”). For a Dirichlet posterior Dir(alpha) with K classes and alpha_0 = sum_c alpha_c, the components are:
Total uncertainty:
H[Dir(alpha)], the differential entropy of the posterior distribution. Appendix E: “The entropy of the posterior distribution Q(theta | chi^post, n^post) was used to estimate the predictive uncertainty”. The paper writes this as “predictive uncertainty”; we map it to the standard UQ “total uncertainty” slot.Aleatoric uncertainty:
H[Cat(alpha / alpha_0)], the entropy of the target distribution evaluated at the posterior mean. Appendix E: “The entropy of the target distribution P(y | theta) was used to estimate the aleatoric uncertainty”. For categorical y the target distribution at chi^post = alpha / alpha_0 is Cat(alpha / alpha_0).Epistemic uncertainty:
K / alpha_0, the vacuity introduced by [SKK18]. Appendix E uses the predicted evidencen^post = alpha_0directly; vacuity is its monotone transform into(0, 1](high = uncertain).
The decomposition is non-additive:
total != aleatoric + epistemicin general, since the three quantities are defined on different spaces.- Parameters:
distribution – A second-order distribution (e.g. a Dirichlet) or a sample from one. Total and aleatoric components require
entropy/entropy_of_expected_predictive_distributionimplementations, while the epistemic component requires avacuityimplementation registered for the input type.base – Logarithm base used for the entropy-based components.
Noneuses the natural logarithm. The vacuity is dimensionless and is unaffected bybase.
- property aleatoric: AU¶
The aleatoric uncertainty of the decomposition.
- base: LogBase¶
- canonical_notion[source]¶
alias of
TotalUncertainty
- distribution: SecondOrderDistributionLike¶
- property epistemic: EU¶
The epistemic uncertainty of the decomposition.
- get(k[, d]) D[k] if k in D, else d. d defaults to None.¶
- items() a set-like object providing a view on D's items¶
- keys() a set-like object providing a view on D's keys¶
- property total: TU¶
The total uncertainty of the decomposition.
- values() an object providing a view on D's values¶