Skip to main content

Learn distributions with normalizing flows.

Project description

zenflow

Coverage Status DOI

Fast conditional flow-based generative models which are implemented as FLAX modules. Conditional PDFs are supported.

License

The source code is released under the MIT license.

Installation

pip install zenflow

Documentation

There is currently no online documentation, but the library has useful docstrings. Please use the docstrings and look into the usage examples in the examples folder.

Citation

If you use this package in a scientific work, please cite us. You can generate citations in your preferred format on the Zenodo website.

History

This project was originally forked from PZFlow by John Franklin Crenshaw, but largely rewritten. PZFlow itself draws from other repositories, which are listed in the PZFlow documentation. I needed a code base which is simple to understand and stripped down to the essentials for my use case. The main differences between PZFlow and zenflow:

  • zenflow uses generic JAX arrays for data input and output, while PZFlow enforces the use of Pandas dataframes.
  • zenflow implements all trainable objects as FLAX modules, while PZFlow uses JAX primitives.
  • zenflow follows a clean functional design inspired by FLAX.
  • zenflow is minimalistic and focussed on providing trainable conditional PDFs with the neural spline coupling technique.

Because all trainable objects are FLAX modules, including the flow object and all bijectors, one can make new FLAX modules that build on flow objects or bijectors, and train the combination. This, for example, allows one to construct conditional PDFs that use complex models like transformers to provide the conditional input, and train everything together. The examples include an application that uses a Deep Set as conditional input for the PDF.

Features of PZFlow that are not included in zenflow:

  • Training on data points with uncertainties.
  • Computing marginalized posterior densities. This can be done "by hand", however.
  • Bijectors that are not needed for the neural spline coupling approach.
  • Support for periodic variables.

Features which are planned:

  • Support for periodic variables.

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

zenflow-0.2.2.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

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

zenflow-0.2.2-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file zenflow-0.2.2.tar.gz.

File metadata

  • Download URL: zenflow-0.2.2.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zenflow-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b5954149b2060c0a1bf61658b2d49529a762c9e432800108a56d5dc61f43d38f
MD5 ed3980518557534d8eea651cc379aecb
BLAKE2b-256 98261d8dd47159635c9e469f6347818098c5ba2144af34707da7017fb802c14c

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenflow-0.2.2.tar.gz:

Publisher: release.yml on HDembinski/zenflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zenflow-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: zenflow-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for zenflow-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2347cda830d80c439d66c023cbe7494744174fe821480e7d7389f01a7c210f2
MD5 d4019ec48adadb92d2bc26e70820e342
BLAKE2b-256 357c1cd30813976677d069e83c99303698030e5a644903bff669fe13c6bf1f9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for zenflow-0.2.2-py3-none-any.whl:

Publisher: release.yml on HDembinski/zenflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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