sbi.utils.get_density_thresholder#
- get_density_thresholder(dist, quantile=0.0001, num_samples_to_estimate_support=1000000)[source]#
Returns function that thresholds a density at a particular 1-quantile.
Reference: Deistler et al. (2022): “Truncated proposals for scalable and hassle-free simulation-based inference”
- Parameters:
dist (Any) – Probability distribution to be thresholded, must have .sample() and .log_prob().
quantile (float) – The returned function will be True for $ heta$ within the 1-quantile high-probability region of the distribution. In other words: quantile is the fraction of mass that is excluded from dist.
num_samples_to_estimate_support (int) – The number of samples that are drawn from dist in order to obtain the threshold. Higher values are more accurate but slower.
- Returns:
Callabe which is true for $ heta$ in the 1-quantile high-probability region of the dist.
- Return type: