Giter VIP home page Giter VIP logo

ctalearn's Introduction

CTALearn Keras

A proof-of-concept project reimagining the architectural design of the CTLearn project.

Major changes with respect to the original repository are:

  • Use of the Keras API for training and prediction
  • Use of Pandas for managing the data spread across multiple files
  • Stronger division of the model building, training and prediction responsibilities
  • the ImageMapper and DataProcessor classes have been hidden from the user

UML diagram

Installing the CTAlearn framework

  1. Install the prerequisites
  2. Download this repo
  3. Run pip install upgrade . from the root folder

Basic functionality: How to build and train a model

  1. Create a folder to be your training folder, cd to it
  2. Create a config.yml file. This file should have the following sections:
    • model_config, specifying how the model should be built
    • data_config, specifying what kind of data to load and how to preprocess it
    • train_config, specifying training options You can check the params to be specified in each section in example_config.yaml.
  3. Run python PATH/TO/PROJECT/ctalearn/train.py config.yml. The outputs of a training session are:
    • model.h5 file containing the results of the training (unless the configuration option save_model is set to false)
    • model_summary.txt file containing a summary of the model architecture
    • session.log file containing a log of messages during training
    • training_history.csv containing the training history
    • logs folder containing tensorboard events. Read them running tensorboard --logdir=logs from the training folder.
    • png plots of the training history progress

Training a preexisting model

Do as before, but run python PATH/TO/PROJECT/ctalearn/train.py config.yml PATH/TO/MODEL/model.h5, where PATH/TO/MODEL/model.h5is the relative path to the model you want to use for training.

Performing grid search

CTALearn has built-in capabilities to enable grid search hyperparameter search.

To use it, just add the prefix multi_ to the parameters where you want to perform grid search in the yaml config file, and specify a range of values to try via a list.

The training script will automatically recognize the multi_ options and perform grid search, generating as many folders as possible combinations of parameters are possible.

Each folder will contain the config file specifying what parameters were used for that run, plus the usual output of a run.

Additionally, the script will generate a csv summary of all the run results and comparative png plots.

Generating the pixel_pos files

In order to work properly, CTALearn relies on the generation of some files containing information needed to perform the mapping from the raw image of the telescopes to 2D images.

ctalearn's People

Contributors

jsevillamol avatar

Stargazers

José Vicente avatar  avatar

Watchers

 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.