Skip to content

Deep learning models to estimate the masses of galaxy clusters from lensed CMB maps

License

Notifications You must be signed in to change notification settings

samuelsimko/clusterlens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Clusterlens

About

This repository contains deep learning models to estimate the masses of galaxy clusters from lensed CMB maps.

Features

  • Generation of training data using LensIt
  • MResUNet, ResNet, and Timm models
  • Training on T, TEB, or TQU maps
  • Multiple labels available: Kappa map, cluster mass, or denoised input maps.

Usage

Create a virtual environment and activate it. Install the requirements:

$ cd clusterlens
$ pip install -r requirements.txt

Create simulated maps by executing gen_maps.py

$ python src/gen_maps.py 1 2 3 4 5 traindata --nsims 64 --cambinifile /path/to/cambinifile
$ python src/gen_maps.py 1 2 3 4 5 validationdata --nsims 64 --cambinifile /path/to/cambinifile

In this example, the script generates maps with masses in (1, 2, 3, 4) * 1e14 M☉. 64 maps are created for each mass. It will store the training maps in the traindata directory, and the validation maps in the validationdata directory.

To train a model, execute the train.py script.

$ python src/train.py --input_type obs_maps --output_type mass  --model mresunet --train_dir traindata --val_dir validationdata --batch_size 16 --max_epochs 30

For more information on the scripts, call them with the argument --help.

The training will create a log folder, which can be opened with Tensorboard. If checkpointing is enabled, the trained model will be saved.

About

Deep learning models to estimate the masses of galaxy clusters from lensed CMB maps

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages