Closed EiffL closed 4 years ago
@nesar @cguilloteau Until I get around to writing an actual documentation, this thread can also be of interest to you, it shows how to train a latent space conditional MAF
Ok, I'm gonna go ahead and merge this as it's already used by @Hbretonniere
@mhuertascompany this PR adds parameters from single sersic fits for COSMOS galaxies. This defines the following "problem"
attrs2img_cosmos_128_euclid
with the following parameters:(see here: https://github.com/ml4astro/galaxy2galaxy/blob/54e5c45361936c1c3e4f89f9443089442bf6ebf3/galaxy2galaxy/data_generators/cosmos.py#L266 )
Which means, the training set of the COMOS galaxies will be drawn at native 0.03 arcsec resolution on postage stamps on size 128, and the image generation will be conditioned on
'mag_auto', 'flux_radius', 'sersic_n', 'sersic_q'
To install the code from this PR:
I'm assuming here you already have GalSim installed, and the COSMOS dataset downloaded (see here https://github.com/GalSim-developers/GalSim/wiki/RealGalaxy%20Data)
The only thing to do now is to generate the dataset:
If this doesn't work, you need to add
--tmp_dir=[Path to the COSMOS_25.2_training_sample ]
Now you can use the encoder/decoder that I've already trained for these images, downloadable here: https://storage.googleapis.com/g2g/modules/vae_cosmos_128/encoder.tar.gz https://storage.googleapis.com/g2g/modules/vae_cosmos_128/decoder.tar.gz
With this dataset, you can train the latent flow model this way:
and then export it using g2g-exporter:
This exports the latent space model as a TF Hub module. A final step to combine the latent space model and the decoder into a single generator model:
And you are done, after that you can use GalSim Hub to generate the images, see this presentation from January: https://slides.com/eiffl/galaxy_morphology#/3