Normalizing flows for gravitational-wave analyses
Project description
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 matrixcalibration_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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gwflow-0.1.0a2.tar.gz.
File metadata
- Download URL: gwflow-0.1.0a2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1c101e14bcad6bb646b19af9651a25d072bc857dbfdcb789f4752869eb3fd9e
|
|
| MD5 |
f30e0a964d188d011ac402306b648c08
|
|
| BLAKE2b-256 |
91800b378901ec3ee4e1f36f70979e172bef44bdaa7e5368b09fa143c705f781
|
Provenance
The following attestation bundles were made for gwflow-0.1.0a2.tar.gz:
Publisher:
publish.yml on mj-will/gwflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gwflow-0.1.0a2.tar.gz -
Subject digest:
c1c101e14bcad6bb646b19af9651a25d072bc857dbfdcb789f4752869eb3fd9e - Sigstore transparency entry: 675374416
- Sigstore integration time:
-
Permalink:
mj-will/gwflow@30f1ad63c627c6bfcbd0be08882e47e23bc407a6 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/mj-will
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30f1ad63c627c6bfcbd0be08882e47e23bc407a6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gwflow-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: gwflow-0.1.0a2-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2af88692dea52ae2ce79515048e67fdcfff5b56cd50c9f0fa98d465b2906c5a5
|
|
| MD5 |
9d2449523f13e17007f78146dbf6a73f
|
|
| BLAKE2b-256 |
64eb1ca1d2443c541f313817ef5473e6035bba02a714a9551329c71e01147f57
|
Provenance
The following attestation bundles were made for gwflow-0.1.0a2-py3-none-any.whl:
Publisher:
publish.yml on mj-will/gwflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gwflow-0.1.0a2-py3-none-any.whl -
Subject digest:
2af88692dea52ae2ce79515048e67fdcfff5b56cd50c9f0fa98d465b2906c5a5 - Sigstore transparency entry: 675374423
- Sigstore integration time:
-
Permalink:
mj-will/gwflow@30f1ad63c627c6bfcbd0be08882e47e23bc407a6 -
Branch / Tag:
refs/tags/v0.1.0a2 - Owner: https://github.com/mj-will
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30f1ad63c627c6bfcbd0be08882e47e23bc407a6 -
Trigger Event:
release
-
Statement type: