Counting 3,742 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Apr. 16, 2019
Jan. 17, 2019



This repository has been moved!

the maintained repository is now: supernnova/SuperNNova

Read the documentation

For the main branch:

The paper branch differs slightly from the master. Take a look to "changelog_paper_to_new_branch" or Build the docs for this branch.


Clone this repository

git clone

or install pip module

pip install supernnova

Read the paper preprint

Paper in ArXiv The paper was produced using the branch "paper".

Table of contents

  1. Repository overview
  2. Getting Started
    1. With Conda
    2. With Docker
  3. Usage
  4. Reproduce paper
  5. Pipeline Description
  6. Running tests
  7. Build the docs

Repository overview

├── supernnova              --> main module
    ├──data                 --> scripts to create the processed database
    ├──visualization        --> data plotting scripts
    ├──training             --> training scripts
    ├──validation           --> validation scripts
    ├──utils                --> utilities used throughout the module
├── tests                   --> unit tests to check data processing
├── sandbox                 --> WIP scripts

Getting started

With Conda

cd env

# Create conda environment
conda create --name <env> --file <conda_file_of_your_choice>

# Activate conda environment
source activate <env>

With Docker

cd env

# Build docker images
make cpu  # cpu image
make gpu  # gpu image (requires NVIDIA Drivers + nvidia-docker)

# Launch docker container
python (--use_gpu to run GPU based container)

For more detailed instructions, check the full setup instructions


When cloning this repository:

# Create data
python --data  --dump_dir tests/dump --raw_dir tests/raw --fits_dir tests/fits

# Train a baseline RNN
python --train_rnn --dump_dir tests/dump

# Train a variational dropout RNN
python --train_rnn --model variational --dump_dir tests/dump

# Train a Bayes By Backprop RNN
python --train_rnn --model bayesian --dump_dir tests/dump

# Train a RandomForest
python --train_rf --dump_dir tests/dump

When using pip, a full example is

# Python
import supernnova.conf as conf
from import make_dataset

# get config args
args =  conf.get_args()

# create database = True            # conf: making new dataset
args.dump_dir = "tests/dump"        # conf: where the dataset will be saved
args.raw_dir = "tests/raw"      # conf: where raw photometry files are saved 
args.fits_dir = "tests/fits"        # conf: where salt2fits are saved 
settings = conf.get_settings(args)  # conf: set settings
make_dataset.make_dataset(settings) # make dataset

Reproduce paper results

Please change to branch paper:


General pipeline description

  • Parse raw data in FITS format
  • Create processed database in HDF5 format
  • Train Recurrent Neural Networks (RNN) or Random Forests (RF) to classify photometric lightcurves
  • Validate on test set

Running tests with py.test

PYTHONPATH=$PWD:$PYTHONPATH pytest -W ignore --cov supernnova tests

Build docs

cd docs && make clean && make html && cd ..
firefox docs/_build/html/index.html