NaturalPosteriorDecomposition

class probly.method.natural_posterior_network.NaturalPosteriorDecomposition(distribution: SecondOrderDistributionLike, base: LogBase = None)[source]

Bases: CachingDecomposition, AleatoricEpistemicTotalDecomposition, Generic

Decomposition 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 evidence n^post = alpha_0 directly; vacuity is its monotone transform into (0, 1] (high = uncertain).

The decomposition is non-additive: total != aleatoric + epistemic in 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_distribution implementations, while the epistemic component requires a vacuity implementation registered for the input type.

  • base – Logarithm base used for the entropy-based components. None uses the natural logarithm. The vacuity is dimensionless and is unaffected by base.

property aleatoric: AU

The aleatoric uncertainty of the decomposition.

base: LogBase
canonical_notion[source]

alias of TotalUncertainty

property components: list[type[Notion]]

The components of the decomposition.

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.
get_canonical() → Notion[source]

Return the canonical notion of the decomposition.

get_notion(notion: type[N]) → N[source]

Return the component corresponding to the given notion.

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