Skip to content

adityaramesh/lantern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Lantern provides utilities for writing maintainable, robust, and efficient training scripts in Torch. Here is an abbreviated list of features:

Starting a project using Lantern typically involves three steps. We have provided a working example of an MNIST classifier in the examples directory for your reference. [This section](#Running the Example) describes how to get it running.

  1. Define the model (see this file for reference).
  2. Write a driver script to train the model (see this file for reference; if you are training a classifier, this example script may already be sufficient for your purposes).
  3. Write a "front-end" script to be invoked from the command-line (see this file for reference).

The model, driver, and front-end scripts are usually independent components of any given experiment. Separating these components allows different versions of each to be developed over time, without the maintainability of the project being compromised by many slightly different versions of the same code.

Installation

luarocks install https://raw.githubusercontent.com/adityaramesh/lantern/master/rockspecs/lantern-0.0-1.rockspec

Running the Example

First, you will need to download the example code and preprocessed data:

git clone https://github.com/adityaramesh/lantern
cd lantern
chmod +x examples/download_data.sh
./examples/download_data.sh

Now you can begin training the classifier as follows:

mkdir experiments
th example/train_classifier.lua -task create -experiment test -gpu 1

Henceforth, attempting to rerun the training script using the same options will fail. Instead, you have two options:

  • Use -task resume, which will resume training from the start of the last unfinished epoch.
  • Use -task replace, which will purge all data from previous runs and train a new model from scratch.

You can change the relative path to the root directory for experiments using the option -experiment_root, which defaults to experiments.

About

A model training and performance monitoring framework for Torch.

Resources

License

Stars

Watchers

Forks

Packages

No packages published