hsimonfroy / montecosmo

Differentiable pipeline for field-level cosmological inference from galaxy surveys.
MIT License
2 stars 0 forks source link

Model Simulation Based Inference #4

Open hsimonfroy opened 7 months ago

hsimonfroy commented 7 months ago

Context

Documenting field-level Simulation Based Inference from a differentiable cosmological model.

In [code], we run joint inferences of the initial field ($\delta_L$, $64^3$ mesh), cosmological parameters ($\Omega_c$ and $\sigma_8$), and Lagrangian bias parameters.

Aims

Justinezgh commented 7 months ago

Here are some useful links:

ds_tr = tfds.load("Mydataset/name_of_the_configuration")



- **Compression** (example [here](https://github.com/DifferentiableUniverseInitiative/sbi_lens/blob/main/scripts/train_compressor.py))
 This part aims to compress your data into summary statistics with dim(summary statistics) = dim(parameters you want to infer).

     - chose an architecture 
     → I usually use [ResNet 18](https://github.com/google-deepmind/dm-haiku/blob/main/haiku/_src/nets/resnet.py)

     - chose a loss function 
     → we can start with vmim ([the paper](https://arxiv.org/abs/2009.08459))

     - check what data augmentation we can do
      → I usually add the noise on the fly and do rotation & flipping (example [here](https://github.com/DifferentiableUniverseInitiative/sbi_lens/blob/main/sbi_lens/gen_dataset/utils.py))

- **Inference**
Based on the previous compression you now want to infer your parameters.
→ NPE should be good  (example [here](https://gist.github.com/Justinezgh/75ee6fbd05c999f81b2d18d61f4fc308))