-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameters of PGD and optimal weighting/cic compensation #89
Comments
Wow, this happened quite quickly, great job :)
|
Thank you @modichirag ! The Box I used is 128 Mpc/h because I had to adapt my setting to the different combinations found in the notebook of Vanessa. If I wanted to use a bigger boxsize, I should use a box size of 256 Mpc/h and only 10 steps for the simulation. |
We now have a PGD implementation thanks to #90 but we still have an open issue of how to find the best weight function and apply CiC compensation, so I'm leaving this issue open. @modichirag if you want to have a look at that, go for it ;-) |
So @modichirag with Denise we looked at the shape of your custom weight function, and it looked very weird, it actually amplified the loss on small scales as far as I can tell... |
Ok, I think I fixed the decic function: from flowpm.utils import r2c3d, c2r3d
from flowpm.kernels import fftk
nc = N
def decic(field, order=-2):
kvec = fftk([nc, nc, nc], symmetric=False)
kwts = [np.sinc(kvec[i]/(2*np.pi)) for i in range(3)]
wts = (kwts[0]*kwts[1]*kwts[2])**order
fieldc = r2c3d(field, norm=nc**3)
fieldc = fieldc * tf.cast(wts, tf.complex64)
field = c2r3d(fieldc, norm=nc**3)
return field Notebook here |
So, as discussed here LSSTDESC/DifferentiableHOS#10 (comment) it seems like offline PGD is failing, we are asking for too much displacement at once. But on the other hand online PGD seems to be doing quite well. I am adding the |
So, last thing we discussed with @modichirag is that we may want to add a tool to fit the PGD params with a high res simulation. We may want to fine tune a little bit the training script so that it can find a better fit at a=0.51. |
This might be good enough for our purposes for now, but @modichirag let me know if you want to dig a little deeper before we move on. |
So.... we are using this implementation of PGD for @dlanzieri project, and we are starting to wonder whether cosmology dependence of PGD is going to be a problem when computing gradients. @modichirag @VMBoehm @Maxelee have you checked at any point how strongly correlated to Omega_m and sigma8 PGD params are? |
so here is a plot, apologies for it being very ugly, but computes the gradients of the matter power spectrum in a snapshot at z=0. It looks like the jacobian with respect to sigma_8 is larger than what it should be, and I think it might agree with what you are seeing @dlanzieri right? |
Hi @modichirag , I compared the matter power spectrum computed with and without PDG. I need know what do you think about these results!
Initially I used kl, ks, mu, and alpha0 parameters obtained by running this Notebook with the following setting for the N-Body simulation :
This is how the power spectrum looks like for all the snapshots:
Because of the alpha parameter we used for the PGD is scale factor dependent according the following relation:
alpha=alpha0*a**mu
,I tried to see how the amplitude of the power spectrum at small scales changes as a function of alpha0 parameter:
I see that the power spectra that better approximate the analytical one are the power spectra obtained with alpha0=0.008, alpha0=0.009, alpha0=0.01, for bigger and smaller values they start to lose power.
This is how the power spectrum looks like for all the snapshots using alpha0=0.01:
Now, I think that probably my scale translation is not right. The kl,ks obtained with the Vanessa's notebook should be in hMpc^(-1), but I'm not sure.
So, still using the the alpha0 obtained from the notebook (alpha0=0.00269), I tried different scale translation:
Here the peaks of the PGD kernel :
and the power spectrum of only one snapshot:
From this plot looks like the right scaling factor for kl and ks are obtained multiplying them for h and 0.5 (this depends how we defined k) .
Assuming this is the better rescaling, I used it to see again how the power spectrum at small scales changes as a function of alpha0
And, alpha0=0.01 still seems like the better choice.
The text was updated successfully, but these errors were encountered: