Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

gwflow

Normalizing flows for gravitational-wave analyses.

gwflow builds on zuko and implements normalizing flows with problem-specific modifications.

Installation

gwflow is currently only available from source:

pip install git+git@github.com:mj-will/gwflow.git

Flows

GWCalFlow

This flow is designed for use in analyses where there are large number of (simple) calibration parameters with approximately Gaussian distributions.

It approximates the distribution over the calibration parameters separately to the main GW parameters. It supports two options for handling the calibration parameters:

  • calibration_model='gaussian': fit a Gaussian with a diagonal covariance matrix
  • calibration_model='nn': fit a neural network that estimates the per-parameter mean and variance for of a diagonal Gaussian

Usage

GWCalFlow supports three different ways of specifying which parameters are 'GW' parameters and which are calibration parameters.

We provided a factory class than can be used to instantiate the flow using various different methods:

from gwflow import GWClaFlow

Then, assuming data lies in an n-dimensional space with parameters that described the signal (GW parameters) and calibration parameters. The objects returned in each support the same functionality as standard flows from zuko.

In all cases, additional keyword arguments can be passed when instantiating the class and these will be used to configure e.g. the normalizing flow.

Parameters names

Using a list of parameter names and regex:

flow = GWCalFlow(
    parameters=["chirp_mass", "mass_ratio", ..., "recalib_H1_amplitude_0", ...],
    calib_regex=".*calib.*",
)

Indices

Using the indices for GW and calibration parameters

flow = GWCalFlow(
    gw_idx=[0, 1, 3],
    cal_idx=[2, 5]
)

Slices

Using slices, assuming the GW parameters are first

flow = GWCalFlow(
    gw_dim=15,
    cal_dim=20,
)

Basic usage

Flows are used in the same way as zuko flows:

flow = GWFlowClas(gw_dim=15, cal_dim=20, context=4, transforms=3)

x = flow().sample((10,))

log_prob = flow().log_prob(x)

# If the flow is conditional
x = flow(c).sample((10,))

For more details, see the zuko documentation

Note: since the transform only applies to a subset of the parameter space, the flow does not expose this attribute.

Citation

If you use gwflow in your work, please cite our DOI (to be added) and zuko.

Metadata

Release files for gwflow 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gwflow 0.1.0a2
File Size Uploaded
gwflow-0.1.0a2.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gwflow 0.1.0a2
File Interpreter ABI Platform
gwflow-0.1.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 18.7 kB

Release files / gwflow-0.1.0a2.tar.gz

Download URL gwflow-0.1.0a2.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c1c101e14bcad6bb646b19af9651a25d072bc857dbfdcb789f4752869eb3fd9e
BLAKE2b-256 checksum
How to use checksums
91800b378901ec3ee4e1f36f70979e172bef44bdaa7e5368b09fa143c705f781
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 6, 2025.

Transparency log

Release files / gwflow-0.1.0a2-py3-none-any.whl

Download URL gwflow-0.1.0a2-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2af88692dea52ae2ce79515048e67fdcfff5b56cd50c9f0fa98d465b2906c5a5
BLAKE2b-256 checksum
How to use checksums
64eb1ca1d2443c541f313817ef5473e6035bba02a714a9551329c71e01147f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Nov 6, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0a2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page