Giter Club home page Giter Club logo

gwinferno's Introduction

CI-Tests GitHub Doc Pages codecov License

GWInferno: Gravitational-Wave Hierarchical Inference with NumPyro

Documentation

view - Documentation

Installation

Clone the reposi)tory

git clone https://github.com/FarrOutLab/GWInferno.git

Recommended to use conda to set up your environment with python>=3.9:

For CPU usage only create an environment and install requirements and GWInferno with:

cd gwinferno
conda create -n gwinferno python=3.10
conda activate gwinferno
conda install -c conda-forge numpyro h5py 
pip install --upgrade pip
pip install -r pip_requirements.txt
python -m pip install .

To enable JAX access to CUDA enabled GPUs we need to specify specific versions to install (See JAX installation instructions for more details). For a GPU enabled environment use:

cd gwinferno
conda create -n gwinferno_gpu python=3.10
conda activate gwinferno_gpu
conda install -c nvidia -c conda-forge jaxlib=*=*cuda* jax cuda-nvcc numpyro h5py
pip install --upgrade pip
pip install -r pip_requirements.txt
python -m pip install .

Quick Start

Given a catalog of GW Posterior samples in standardized PESummary format, defined by catalog.json file to run population inference with GWInferno one must write a yaml file defining the desired model, hyperparameters, and other auxiliary configuration arguments.

For example a simple config.yml file that defines a Truncated Powerlaw population model over primary masses (i.e. mass_1) we have:

# Run Label
label: Truncated_Powerlaw_mass_1

# Population Parameters, Models, HyperParameters, and Priors
models:
  mass_1:
    model: gwinferno.numpyro_distributions.Powerlaw
    hyper_params:
      alpha:
        prior: numpyro.distributions.Normal
        prior_params:
          loc: 0.0
          scale: 3.0
      minimum:
        prior: numpyro.distributions.Uniform
        prior_params:
          low: 2.0
          high: 10.0
      maximum:
        prior: numpyro.distributions.Uniform
        prior_params:
          low: 50.0
          high: 100.0

# Sampler Configuration Args
sampler:
  kernel: NUTS
  kernel_kwargs:
    dense_mass: true
  mcmc_kwargs:
    num_warmup: 500
    num_samples: 1500
    num_chains: 1

# Data Configuration Args
data:
  catalog_summary_json: /path/to/catalog/summary/file/catalog.json

with this file written and ready to go run to perform inference!

gwinferno_run_from_config.py config.yml

License

Released under MIT by @FarrOutLab.

Citation

If GWInferno is used please cite this paper

We make use of and build upon other open source software projects, please cite them if using GWInferno.

Authors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.