GithubHelp home page GithubHelp logo

smsharma / mining-for-substructure-lens Goto Github PK

View Code? Open in Web Editor NEW
28.0 8.0 10.0 207.41 MB

Inference of substructure properties in strong lensing systems with machine learning. Code repository associated with https://arxiv.org/abs/1909.02005.

License: MIT License

Python 12.15% Jupyter Notebook 49.51% Shell 1.42% TeX 36.92%
gravitational-lensing machine-learning

mining-for-substructure-lens's Introduction

Inferring dark matter substructure with machine learning

Code repository for the paper Mining for Dark Matter Substructure: Inferring subhalo population properties from strong lenses with machine learning by Johann Brehmer, Siddharth Mishra-Sharma, Joeri Hermans, Gilles Louppe, and Kyle Cranmer.

License: MIT Dark matter arXiv

Visualization of Bayesian inference on substructure properties.

Abstract

The subtle and unique imprint of dark matter substructure on extended arcs in strong lensing systems contains a wealth of information about the properties and distribution of dark matter on small scales and, consequently, about the underlying particle physics. However, teasing out this effect poses a significant challenge since the likelihood function for realistic simulations of population-level parameters is intractable. We apply recently-developed simulation-based inference techniques to the problem of substructure inference in galaxy-galaxy strong lenses. By leveraging additional information extracted from the simulator, neural networks are efficiently trained to estimate likelihood ratios associated with population-level parameters characterizing substructure. Through proof-of-principle application to simulated data, we show that these methods can provide an efficient and principled way to simultaneously analyze an ensemble of strong lenses, and can be used to mine the large sample of lensing images deliverable by near-future surveys for signatures of dark matter substructure.

Results

In figures/ we collect the figures shown in the paper. The folder also contains a few additional plots and animations:

  • deflection_maps.pdf shows an example simulated lens including the subhalos, the deflection map from the host halo, and the deflection map from all subhalos combined.
  • calibration_curves.pdf shows calibration curves (raw network output vs calibrated likelihood ratio) for several randomly chosen parameter points.
  • live_inference_population.gif shows the evolution of the posterior on the population-level parameters with successive simulated observations.
  • live_inference_shmf.gif shows the evolution of the posterior on the subhalo mass function with successive simulated observations.
  • live_inference_both.gif and live_inference_with_images.gif combine the evolution of both posteriors, the latter (shown at the top of this readme) also includes the simulated observed lensed images.

Code

The dependencies of our code are listed in environments.yml.

The starting point of our code based are five high-level scripts:

  • simulate.py starts the simulation of lensing systems and, depending on the command-line parameters, creates training, calibration, or test samples.
  • combine_samples.py makes it easy to combine multiple simulation runs into a single file as a preparation for training.
  • train.py trains neural networks on the simulated data.
  • test.py steers the evaluation of the estimated likelihood ratio on test or calibration data.
  • calibrate.py calibrated network predictions based on histograms of the network output.

All scripts can be called with the argument --help to show the command line options. In scripts/ we collect the actual calls we used (on a HPC environment) during this project.

Generally, the simulation code resides in simulation, while the inference code is in the inference folder. Notebooks in notebooks contain the plotting code.

Note: Internally the code uses a different convention for the SHMF slope beta than in the paper. The relation is beta_code = beta_paper - 1, so the fiducial value beta = -0.9 from the paper is internally represented as beta = -1.9.

References

If you use this code, please cite our paper:

@article{Brehmer:2019jyt,
      author         = "Brehmer, Johann and Mishra-Sharma, Siddharth and Hermans,
                        Joeri and Louppe, Gilles and Cranmer, Kyle",
      title          = "{Mining for Dark Matter Substructure: Inferring subhalo
                        population properties from strong lenses with machine
                        learning}",
      year           = "2019",
      eprint         = "1909.02005",
      archivePrefix  = "arXiv",
      primaryClass   = "astro-ph.CO",
      SLACcitation   = "%%CITATION = ARXIV:1909.02005;%%"
}

The inference method is based on 1805.00013, 1805.00020, 1805.12244, and 1808.00973.

mining-for-substructure-lens's People

Contributors

glouppe avatar johannbrehmer avatar smsharma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.