zenflow
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.
Metadata
Release files for zenflow 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zenflow-0.2.2.tar.gz | 3.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zenflow-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.4 MB
Release files / zenflow-0.2.2.tar.gz
| Download URL | zenflow-0.2.2.tar.gz |
|---|---|
| Size | 3.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5954149b2060c0a1bf61658b2d49529a762c9e432800108a56d5dc61f43d38f
|
|
BLAKE2b-256 checksum How to use checksums |
98261d8dd47159635c9e469f6347818098c5ba2144af34707da7017fb802c14c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 22, 2025.
Transparency logRelease files / zenflow-0.2.2-py3-none-any.whl
| Download URL | zenflow-0.2.2-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2347cda830d80c439d66c023cbe7494744174fe821480e7d7389f01a7c210f2
|
|
BLAKE2b-256 checksum How to use checksums |
357c1cd30813976677d069e83c99303698030e5a644903bff669fe13c6bf1f9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 22, 2025.
Transparency log