---
# System prepended metadata

title: Highest halo mass inference

---

# Highest halo mass inference

* Now the model includes a proper CNN transformation of the density field. 
* This also includes the history information by providing density at z=0.5 and z=1.0.
<!-- * Here test with box resolution of 7.5Mpc/$h$, i.e. nside=64.
* Summary vector can be extracted via CNN with $s$ filter size of the kernel. Here fixing s=3, i.e. filter size of 7.5*3 = 22.5Mpc/$h$.  -->
* Overall model structure:
    * Transform the density grids for voxel size $v_{\rm sim}$ using three CNNs to predict $n_f$ features.
        * The CNNs are using a feature with kernel with filter size of $n_{k}$.
    * Use the features to learn a mixture of gaussian distribution with $n_g$ gaussians
    * Use this mixture of gaussians as a base distribution and learn a sequence of $n_{\rm NSF}$ neural spline flow on top on this.
    * In the following tests we fix $v_{\rm sim} = 15$Mpc/$h$, $n_f = 64$, $n_g=10$, $n_{\rm NSF} = 7$.
* On the data side, we transform the input $\log{M}$ with another log-transformation, so that it does not have a sharp edge at the $M_{\rm min}$, which seems important as gaussians have support from $[-\infty, \infty]$. The transformed histogram of $\textit{highest mass halo}$ in each voxel looks like:


| Original | Transformed | 
| :--------: | :--------: |
| ![](https://i.imgur.com/XQWSb6S.png)     | ![](https://i.imgur.com/EQC6SZ4.png)    | 


* Here is how the histogram residuals of this 1pt histogram look like for full, high and low density bins:

![](https://i.imgur.com/EgoX2Ed.png)
![](https://i.imgur.com/O0UFgZe.png)
![](https://i.imgur.com/ElAUppq.png)


* How it looks like for higher resolution simulation:
![](https://i.imgur.com/pHpnofp.png)
![](https://i.imgur.com/YnExDJ0.png)
![](https://i.imgur.com/ZFtSVeM.png)





<!-- * To-do:
- [ ]  -->



