Skip to main content

Probabilistic modeling of tabular data with normalizing flows.

Project description

build codecov PyPI version DOI Docs

PZFlow

PZFlow is a python package for probabilistic modeling of tabular data with normalizing flows.

If your data consists of continuous variables that can be put into a Pandas DataFrame, pzflow can model the joint probability distribution of your data set.

The Flow class makes building and training a normalizing flow simple. It also allows you to easily sample from the normalizing flow (e.g., for forward modeling or data augmentation), and calculate posteriors over any of your variables.

There are several tutorial notebooks in the docs.

Installation

See the instructions in the docs.

Citation

If you use this package in your research, please cite the following two sources:

  1. The paper
@ARTICLE{2024AJ....168...80C,
       author = {{Crenshaw}, John Franklin and {Kalmbach}, J. Bryce and {Gagliano}, Alexander and {Yan}, Ziang and {Connolly}, Andrew J. and {Malz}, Alex I. and {Schmidt}, Samuel J. and {The LSST Dark Energy Science Collaboration}},
        title = "{Probabilistic Forward Modeling of Galaxy Catalogs with Normalizing Flows}",
      journal = {\aj},
     keywords = {Neural networks, Galaxy photometry, Surveys, Computational methods, 1933, 611, 1671, 1965, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Cosmology and Nongalactic Astrophysics},
         year = 2024,
        month = aug,
       volume = {168},
       number = {2},
          eid = {80},
        pages = {80},
          doi = {10.3847/1538-3881/ad54bf},
archivePrefix = {arXiv},
       eprint = {2405.04740},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2024AJ....168...80C},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
  1. The Zenodo deposit associated with the version number you used. The Zenodo deposit

Sources

PZFlow was originally designed for forward modeling of photometric redshifts as a part of the Creation Module of the DESC RAIL project. The idea to use normalizing flows for photometric redshifts originated with Bryce Kalmbach. The earliest version of the normalizing flow in RAIL was based on a notebook by Francois Lanusse and included contributions from Alex Malz.

The functional jax structure of the bijectors was originally based on jax-flows by Chris Waites. The implementation of the Neural Spline Coupling is largely based on the Tensorflow implementation, with some inspiration from nflows.

Neural Spline Flows are based on the following papers:

NICE: Non-linear Independent Components Estimation
Laurent Dinh, David Krueger, Yoshua Bengio
arXiv:1410.8516

Density estimation using Real NVP
Laurent Dinh, Jascha Sohl-Dickstein, Samy Bengio
arXiv:1605.08803

Neural Spline Flows
Conor Durkan, Artur Bekasov, Iain Murray, George Papamakarios
arXiv:1906.04032

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pzflow-3.3.0.tar.gz (8.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pzflow-3.3.0-py3-none-any.whl (8.7 MB view details)

Uploaded Python 3

File details

Details for the file pzflow-3.3.0.tar.gz.

File metadata

  • Download URL: pzflow-3.3.0.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for pzflow-3.3.0.tar.gz
Algorithm Hash digest
SHA256 b54e40b0e8bf512041816fff1473804290bc0a3082b9f4f3973e5dc4b64030bc
MD5 3c23717d650a669ebc8afe1872d8c5dd
BLAKE2b-256 4ddcc187289087ceb19ae89d42f66cc395fbe4d50eb8622e621ad0686c40f4a0

See more details on using hashes here.

File details

Details for the file pzflow-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: pzflow-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for pzflow-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e0aec532948d8462005651a8dfaf530cdf419fdaa5cefb49b895806e313abeb
MD5 43b65699c9cf5d7a349b10753e2ef94d
BLAKE2b-256 7ebfdb90cb9c94033dc832c16bc6ea900d32b53259ed314414633bf1fc89485b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page