Coder Social home page Coder Social logo

xdf-gan's Introduction

Generative deep fields: arbitrarily sized, random synthetic astronomical images through deep learning

Generate mock galaxy surveys with a Spatial GAN (SGAN)-like architecture.

Model description

An SGAN is used to generate mock galaxy surveys from data that is preprocessed as little as possible (preprocessing is only a 99.99th percentile clipping). Therefore real physics can be done on the outputs!

The outputs can also be tesselated together to create a very large survey (see Very Large XDF, below), limited in size only by the RAM of the generation machine.

Examples

Very Large XDF

By layering randomly sized crops (and interpolating them all to the same size) of the above large image we can get a result like this:

Layered XDF

A comparison between the real and generated extreme deep fields:

Real XDF Generated XDF

Training the model

Run preprocess_fits.ipynb to download and channel-wise clip the XDF FITS data at 99.99%.

If we want to train from scratch to 10,000 epochs we would run the following code:

python sgan.py -e 10001 -f $FITS_IMAGE_FILE

Generating a set of imagery

To generate a set of 4 FITS images from the model $KERAS_MODEL_FILE, that are the same size as the XDF:

python run-sgan.py --model $KERAS_MODEL_FILE -z 232 -n 4 -f

These images are dumped into the default log directory.

Generating a very large image that can't fit in memory

We may want to generate a very large FITS image that won't fit in memory (say 60,000 by 60,000 pixels). To do this we can split the noise array, pass it through the GAN, and stitch the outputs back together. This is what run-sgan-tessellate.py does:

python run-sgan-tesselate.py --model $KERAS_MODEL_FILE -z 1024 -f

The above code creates a 16384 by 16384 image (16 times z) using the model $KERAS_MODEL_FILE, and dumps the output into a fits file in the default log directory.

xdf-gan's People

Contributors

smith42 avatar

Watchers

Noon van der Silk avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.