JAX-COSMO: An End-to-End Differentiable and GPU Accelerated Cosmology Library
arXiv:2302.05163 · doi:10.21105/astro.2302.05163
Abstract
We present jax-cosmo, a library for automatically differentiable cosmological theory calculations. It uses the JAX library, which has created a new coding ecosystem, especially in probabilistic programming. As well as batch acceleration, just-in-time compilation, and automatic optimization of code for different hardware modalities (CPU, GPU, TPU), JAX exposes an automatic differentiation (autodiff) mechanism. Thanks to autodiff, jax-cosmo gives access to the derivatives of cosmological likelihoods with respect to any of their parameters, and thus enables a range of powerful Bayesian inference algorithms, otherwise impractical in cosmology, such as Hamiltonian Monte Carlo and Variational Inference. In its initial release, jax-cosmo implements background evolution, linear and non-linear power spectra (using halofit or the Eisenstein and Hu transfer function), as well as angular power spectra with the Limber approximation for galaxy and weak lensing probes, all differentiable with respect to the cosmological parameters and their other inputs. We illustrate how autodiff can be a game-changer for common tasks involving Fisher matrix computations, or full posterior inference with gradient-based techniques. In particular, we show how Fisher matrices are now fast, exact, no longer require any fine tuning, and are themselves differentiable. Finally, using a Dark Energy Survey Year 1 3x2pt analysis as a benchmark, we demonstrate how jax-cosmo can be combined with Probabilistic Programming Languages to perform posterior inference with state-of-the-art algorithms including a No U-Turn Sampler, Automatic Differentiation Variational Inference,and Neural Transport HMC. We further demonstrate that Normalizing Flows using Neural Transport are a promising methodology for model validation in the early stages of analysis.
References in corpus (3)
Cited by in corpus (26)
- The CosmoVerse White Paper: Addressing observational tensions in cosmology with systematics and fundamental physics
- SPT-3G D1: CMB temperature and polarization power spectra and cosmology from 2019 and 2020 observations of the SPT-3G Main field
- CosmoPower-JAX: high-dimensional Bayesian inference with differentiable cosmological emulators
- Capse.jl: efficient and auto-differentiable CMB power spectra emulation
- Differentiable Programming for Earth System Modeling
- candl: Cosmic Microwave Background Analysis with a Differentiable Likelihood
- DISCO-DJ I: a differentiable Einstein-Boltzmann solver for cosmology
- LimberJack.jl: auto-differentiable methods for angular power spectra analyses
- LINX: A Fast, Differentiable, and Extensible Big Bang Nucleosynthesis Package
- Simulation-Based Inference Benchmark for Weak Lensing Cosmology
- On the degeneracies between baryons, massive neutrinos and f(R) gravity in Stage IV cosmic shear analyses
- Comparison of Affine and Rational Quadratic Spline Coupling and Autoregressive Flows through Robust Statistical Tests
- Machine learning unveils the linear matter power spectrum of modified gravity
- Reducing nuisance prior sensitivity via non-linear reparameterization, with application to EFT analyses of large-scale structure
- On the Generality and Persistence of Cosmological Stasis
- A Differentiable, End-to-End Forward Model for 21 cm Cosmology: Estimating the Foreground, Instrument, and Signal Joint Posterior
- Field-level multiprobe analysis of the CMB, integrated Sachs-Wolfe effect, and the galaxy density maps
- Differentiable Cosmological Hydrodynamics for Field-Level Inference and High Dimensional Parameter Constraints
- jaxspec : a fast and robust Python library for X-ray spectral fitting
- : fast differentiable angular power spectra beyond Limber
- Differentiable Modeling of Planet and Substellar Atmosphere: High-Resolution Emission, Transmission, and Reflection Spectroscopy with ExoJAX2
- Impact of redshift distribution uncertainties on Lyman-break galaxy cosmological parameter inference
- Genetic algorithm demystified for cosmological parameter estimation
- Benchmarking field-level cosmological inference from galaxy redshift surveys
- Diagnosing Systematic Effects Using the Inferred Initial Power Spectrum
- FlowSN: Neural Simulation-Based Inference under Realistic Selection Effects applied to Supernova Cosmology