GithubHelp home page GithubHelp logo

merger_transfer_learning's Introduction

Transfer Learning

This project is the implementation of the learning protocol in the paper "Using transfer learning to detect galaxy mergers". This code can be used to exactly replicate the results of the paper with the original merger dataset, or for training with a completely new dataset.

Prerequisites

Linux or OSX

NVIDIA GPU + CUDA CuDNN for training on GPU's

Dependencies

The code is tested on python 3.5

Training requires the following python packages: tensorflow, numpy, keras, tqdm

Get our code

Clone the repo:

git clone https://github.com/SpaceML/merger_transfer_learning.git
cd  merger_transfer_learning/

Run our code

Directory structure for dataset

The original dataset can be found in this Google Drive folder: https://drive.google.com/open?id=1klSL9wZs3cZqAqmvFJVHxkPyXCbXN0-j

The code assumes a directory structure like the following one:

dataset_root/
└── merger
    └── training
        └── images
            ├── 00001.jpeg
             ⋮
    └── validation
        └── images
            ├── 01001.jpeg
             ⋮
    └── test
        └── images
            ├── 02001.jpeg
             ⋮
└── noninteracting
    └── training
        └── images
            ├── 00001.jpeg
             ⋮
    └── validation
        └── images
            ├── 01001.jpeg
             ⋮
    └── test
        └── images
            ├── 02001.jpeg
             ⋮

If you wish to use different class label names, please modify the respective default arguments in make_generators(path_images, positive_class, negative_class) in the file training.py.

If you use your own data set, please also update the corresponding default arguments in training_loop(...) in the file training.py.

Training

python training.py --path_images /path/to/dataset --path_checkpoints /where/checkpoints/go --path_statuses /where/logging/goes --mode [transferlearning|randinit]

The training will not stop automatically, you can monitor the progress in terms of the performance metrics on the validation set, and terminate the training manually as soon as overfitting occurs.

merger_transfer_learning's People

Contributors

hantianz avatar kevinschawinski 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.