SpaceML/GalaxyGAN

Name: GalaxyGAN

Owner: SpaceML

Description: null

Created: 2016-11-29 11:44:02.0

Updated: 2017-08-12 02:45:58.0

Pushed: 2017-07-25 16:29:09.0

Homepage: null

Size: 32091

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits
Hantian Zhang2017-07-25 12:43:38.01
Gokula Krishnan2017-01-07 17:12:23.03
Seth Ariel Green2017-07-06 15:17:54.01
Yiru Chen2017-02-21 14:50:28.04

Other Committers

UserEmailMost Recent Commit# Commits
Hantian Zhanghantian@public-docking-cx-0414.ethz.ch2017-02-03 14:52:39.01
Hantian Zhanghantian@public-docking-cx-0568.ethz.ch2017-02-08 15:52:33.01
Hantian Zhanghantian@public-docking-cx-2860.ethz.ch2016-11-30 21:18:18.02
Hantian Zhanghantian@public-docking-cx-4041.ethz.ch2016-12-05 16:10:32.013
Hantian Zhanghantian@public-docking-hpx-3692.ethz.ch2016-11-29 12:05:31.05
Hantian Zhanghantian@sgd-hanzhang-01.ethz.ch2017-07-25 16:29:05.06
Ubuntuubuntu@ip-172-31-19-171.ec2.internal2016-12-05 15:27:19.06

README

Running it On AWS

EC2 Public AMI

We provide an EC2 AMI with the following pre-installed packages:

as well as the FITS file we used in the paper(saved in ~/fits_train and ~/fits_test)

AMI Id: ami-6f48b379 . (Can be launched using p2.xlarge instance in GPU compute catagory)

Launch an instance.

Connect to Amazon EC2 Machine

Please follow the instruction of Amazon EC2.

note: If you get error like “nvidia-uvm 4.4.0-62 generic” was missing, this is because Amazon updated the kernal of the Ubuntu system, please re-install the cuda again.

Activate Matlab
Get Our Code
git clone --recursive https://github.com/SpaceML/GalaxyGAN.git
Run Our Code

Please execute the following three commands and you will get the result that we got in our paper.

cd GalaxyGAN
bash train.sh -input ~/fits_train -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -model models

This will run the trainning on all FITS files in ~/fits_train.

bash test.sh -input ~/fits_test -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -output result -model models -mode full

This will run the testing on all FITS files in ~/fits_test and you can see the results in result/1.4_1.2/latest_net_G_test/.

bash test.sh -input ~/fits_test -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -output result -model models -mode blank

This will run the testing on all FITS files in ~/fits_test, just the groundtruth is made blank to make sure the testing doesn't use the information of groundtruth image that we provide. In the figures/test/ you can see the groundtruth are left blank and you can still get the same output in result/1.4_1.2/latest_net_G_test/ as the previous command.

You can vary the parameters after -fwhm and -sigma to change the variance of gaussian filter and white noise level to the number you want.

It will take about 5 hours to train the model on an Amazon EC2 p2.xlarge instance.

Running It locally

Prerequisites

Linux or OSX

NVIDIA GPU + CUDA CuDNN (CPU mode and CUDA without CuDNN may work with minimal modification, but untested)

Dependencies

Install torch and dependencies from https://github.com/torch/distro

Install torch packages nngraph, threads and display

luarocks install nngraph
luarocks install threads
luarocks install https://raw.githubusercontent.com/szym/display/master/display-scm-0.rockspec

Install matlab

Install imagemagick

Get Our Code
git clone --recursive https://github.com/SpaceML/GalaxyGAN.git
cd GalaxyGAN
Get and Unzip Our Fits Files

The data to download is about 5GB, after unzipping it will become about 16GB.

bash download.sh 
Run Our Code

Please execute the following three commands and you will get the result that we got in our paper.

bash train.sh -input fitsdata/fits_train -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -model models

This will run the trainning on all FITS files in fitsdata/fits_train.

bash test.sh -input fitsdata/fits_test -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -output result -model models -mode full

This will run the testing on all FITS files in fitsdata/fits_test and you can see the results in result/1.4_1.2/latest_net_G_test/.

bash test.sh -input fitsdata/fits_test -fwhm 1.4 -sigma 1.2 -figure figures -gpu 1 -output result -model models -mode blank

This will run the testing on all FITS files in fitsdata/fits_test, just the groundtruth is made blank to make sure the testing doesn't use the information of groundtruth image that we provide. In the figures/test/ you can see the groundtruth are left blank and you can still get the same output in result/1.4_1.2/latest_net_G_test/ as the previous command.

You can vary the parameters after -fwhm and -sigma to change the variance of gaussian filter and white noise level to the number you want.

It will take about 5 hours to train the model on an Amazon EC2 p2.xlarge instance.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.