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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pzflow-3.2.0.tar.gz
  • Upload date:
  • Size: 8.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/23.2.0

File hashes

Hashes for pzflow-3.2.0.tar.gz
Algorithm Hash digest
SHA256 c0018fe36be0f693a56644ade2f85052c757fef238c3d6b3510b7344ab90d54e
MD5 0f85f958b283ec717a36d9fd919187dd
BLAKE2b-256 83d5867c949c53ad09b9109b7605c1a91f79c0b317798ad2221bf5ce15d4eecf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pzflow-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/23.2.0

File hashes

Hashes for pzflow-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b6b2565abc057bca2cb6b034f5a80858834d45f0d97220e8af91473077095db
MD5 c3cd3bcdca34343a8346a0247e6f7948
BLAKE2b-256 5974264bce90f8fe6bd7462a5f26b8a823cf6774a294a2f4c89e9f4f79a02c0b

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