PosteriorNetworkDecomposition¶
- class probly.method.posterior_network.PosteriorNetworkDecomposition(distribution: SecondOrderDistributionLike)[source]¶
Bases:
CachingDecomposition,AleatoricEpistemicDecomposition,GenericDecomposition based on the Posterior Network.
Implements the two uncertainty scoring functions formally proposed by PostNet [CZugnerGunnemann20] in its Sec. 4 (“Metrics”):
Aleatoric uncertainty:
1 - max_c (alpha_c / alpha_0), the max-probability complement of the predictive distribution. The paper reports this as the aleatoric confidence scoremax_c p_bar_c(“Alea. Conf” / “OOD Alea” in every results table); this implementation flips it to a complement so that high values indicate high uncertainty.Epistemic uncertainty:
K / alpha_0, the vacuity introduced by [SKK18]. This is monotonically equivalent to the paper’s “OOD Epist” scorealpha_0while being bounded in(0, 1].
The paper does not formally propose a “total uncertainty” scoring function; the predictive entropy used in Fig. 4 of the paper is also not a formal aleatoric metric (it is only used for OOD/OODom histograms). Consequently this decomposition has only aleatoric and epistemic slots, and no canonical notion (both are equally valid).
- Parameters:
distribution – A second-order distribution (e.g. a Dirichlet) or a sample from one. The aleatoric component requires a
max_probability_complement_of_expectedimplementation, and the epistemic component requires avacuityimplementation registered for the input type.
- property aleatoric: AU¶
The aleatoric uncertainty of the decomposition.
- canonical_notion = None¶
- 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¶
- values() an object providing a view on D's values¶