Git Product home page Git Product logo

cosmo_estimators's Introduction

Cosmological Parameter Estimation and Inference using Deep Summaries

This repostitory includes the code used in the Fluri et al. (2021). The examples in the notebooks folder show how to use the code and reproduce most of the figures presented in the paper. Please read the Installation section to install the required packages.

Notebooks

The examples in the notebooks folder give an introduction to the following things:

  1. data_generation.ipynb This notebook shows how one can generate the data used in the experiments section of the paper. Note that the entire dataset needs more than 1TB of free space. We do not recommend to generate the entire dataset on a local machine.

  2. GCNN.ipynb This notebook gives and introduction into the graph convolutional neural networks (GCNN) used in the paper. It shows how to use the loss function presented in the paper and provides functions to create first order parameter estimators.

  3. GP_ABC.ipynb How to use Gaussian process regression on ABC log-posterior estimates. It provides functions that estimate the ABC log-posterior and their uncertainties, as well as a Gaussian process regression module. It can reproduce the constraints (Figure 4) of the 2D model presented in the paper.

  4. ground_truth.ipynb This notebook implements the true likelihood function of the cosmological model used in the paper. We also provide the MCMC chain of the 2D model.

Installation

Please note, that some of the packages required for the installation are not working properly on Windows. We strongly recomment doing eveything in a fresh virtual python environment. The code has been developed and tested with python version 3.6, it does not work with python 2.7. To install the requirements proceed as follows. First you can install all requirements from the requirements file

pip install -r requirements.txt

There are two packages that can lead to some problems. The first one, horovod, needs to be installed after the other requirements. Theoretically, one can install it with pip:

pip install horovod==0.21.1

Note that you should add the --no-cache flag, if you already have installed horovod in a different environment for a different tensorflow version. If you have trouble installing horovod please consult their website.

The second one is the Core Cosmology Library (CCL) which has a python wrapper called pyccl. If you use conda, the installation should be as easy as:

conda install -c conda-forge pyccl

To install pyccl with pip you need to install additional packages like CMake. The procedure is described on their website.

The examples in the notebooks folder use jupyter notebooks. If you already have a jupyter installtion on your machine, you can register your environment there, as described here. Otherwise you can freshly install it

pip install jupyterlab notebook

and start it up with

jupyter notebook

cosmo_estimators's People

Contributors

jafluri avatar

Stargazers

 avatar  avatar Michaël Defferrard avatar

Watchers

 avatar

Forkers

rintaro0406

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.