igmhub / LaCE

Emulator for the one-dimensional Lyman-alpha flux power spectrum. It was used to generate the results shown in https://arxiv.org/abs/2011.15127, https://arxiv.org/abs/2209.09895, and https://arxiv.org/abs/2305.19064.
1 stars 3 forks source link

Update or drop the default emulator stored in file #9

Closed andreufont closed 1 year ago

andreufont commented 1 year ago

Right now there is the option to not train the emulator, and instead load the default hyperparameters from file (see load_default function in gp_emulator.py).

This would be useful if the training was slow, but lately it takes a second to train the emulator, and we never use it anymore. We could drop it entirely.

If we wanted to keep the option, it would be useful to update the file stored, since currently it assume an obsolete setting for the emulator (symmetric kernel, including also a linear term).

andreufont commented 1 year ago

I modified the code in #8 to raise an error if you are trying to load the default emulator from file, and the settings do not match. This should be enough for now, but it would be good to fix at some point (or delete the load_default option).

lauracabayol commented 1 year ago

Ok, I tried some time ago to used pre-trained models and the code broke. I could fix it, but as you point out it's not clear it makes sense in the Gadget simulations. It could be helpful if I found a GP confguration working better than NN on Nyx files

andreufont commented 1 year ago

Let's leave it for now, I just wanted to add the issue in case someone find this problem

andreufont commented 1 year ago

Now that we have a fully working NN emulator, I think the GP emulator should be kept in the lightest possible form, such that we can replicate the emulator from Pedersen2021 and Pedersen2023. Both emulators could be trained in a couple of seconds, so I think we can drop the option to load pre-trained GP emulators. Do you agree @lauracabayol ? Nothing urgent, and I can take care of this, but I wanted to clean old issues from the repo.

andreufont commented 1 year ago

The option to write / read a trained GP emulator is no longer available, but this is fine since it takes a second.

The NN emulator can be write / read from file.