nbi: the Astronomer's Package for Neural Posterior Estimation

Keming Zhang, Joshua S. Bloom, Stéfan van der Walt, Nina Hernitschek
12/6/2023
astro-ph.IMcs.LGphysics.data-an

Official code: kmzzhang/nbi (42 stars, last commit 2025-08-12).

Abstract

Despite the promise of Neural Posterior Estimation (NPE) methods in astronomy, the adaptation of NPE into the routine inference workflow has been slow. We identify three critical issues: the need for custom featurizer networks tailored to the observed data, the inference inexactness, and the under-specification of physical forward models. To address the first two issues, we introduce a new framework and open-source software nbi (Neural Bayesian Inference), which supports both amortized and sequential NPE. First, nbi provides built-in "featurizer" networks with demonstrated efficacy on sequential data, such as light curve and spectra, thus obviating the need for this customization on the user end. Second, we introduce a modified algorithm SNPE-IS, which facilities asymptotically exact inference by using the surrogate posterior under NPE only as a proposal distribution for importance sampling. These features allow nbi to be applied off-the-shelf to astronomical inference problems involving light curves and spectra. We discuss how nbi may serve as an effective alternative to existing methods such as Nested Sampling. Our package is at https://github.com/kmzzhang/nbi.

View on arXivView PDF

Code Implementations(1)

kmzzhang/nbiOfficial100%

Package for Neural Posterior Estimation and Importance Sampling focused on Astronomical Applications

427PythonApr 18, 20221 years agoNOASSERTION

Similar Papers

Cite this paper

@article{zhang2023nbi,
  title  = {nbi: the Astronomer's Package for Neural Posterior Estimation},
  author = {Keming Zhang and Joshua S. Bloom and Stéfan van der Walt and Nina Hernitschek},
  year   = {2023},
  eprint = {2312.03824},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.03824v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.03824.svg)](https://codeofpaper.com/paper/2312.03824)

Discussion