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-4.0.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-4.0.0-py3-none-any.whl (8.7 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pzflow-4.0.0.tar.gz
Algorithm Hash digest
SHA256 c3fa595a58af278d42bc41dc0b1d4c98dcc271dd51e872eb1b9273cb234b714a
MD5 736af05b907fc8145cc7098e59d3999d
BLAKE2b-256 79abfb44083de9070ec38a8ac49c85c1064fb09bc3f0f72b0839aa0efa243d39

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pzflow-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df593c6849387fc5a9f97175d887db1e966a551fd4787f37312d0eaf0a89401d
MD5 170f7ca0be403ebe78c90dc3da6b7a51
BLAKE2b-256 83aee82e55ea0ceb5d2a337714b691dc1022ed6251d705f49e437ae3bb42bb43

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