Created: 2011-07-06 20:45
Updated: 2015-06-19 07:26

This repo is a container for all my Torch7 packages.

Note: all these packages used to be distributed into a big messy repo called XLearn.

Retrieve all packages

This repo is empty, and only contains references to other GIT repos. You can retrieve all of them like this:

$ git submodule init
$ git submodule update


1/ Torch7 and dependencies:

On Linux (Ubuntu > 9.04):

$ apt-get install gcc g++ git libreadline5-dev cmake wget libqt4-core libqt4-gui libqt4-dev

On Mac OS (Leopard, or more), using Homebrew:

$ brew install git readline cmake wget qt

Then on both platforms:

$ git clone
$ cd torch
$ mkdir build; cd build
$ cmake ..
$ make
$ [sudo] make install

2/ Packages:

Once Torch7 is installed, it comes with a package manager that you can use to either install packages from the web:

$ torch-pkg install pkg-name
$ torch-pkg --help

or build them locally, if you are planning to work on the sources:

$ cd pkg-name
$ torch-pkg deploy

Use Torch7

First run torch, and load a package:

$ torch
> require 'imgraph'

Once loaded, tab-completion will help you navigate through the library (note: tab-completion will only work if you have Qt4 and readline):

> imgraph. + TAB
imgraph.colorize(           imgraph.connectcomponents(  
imgraph.graph(              imgraph.histpooling(        
imgraph.segmentmst(         imgraph.testme(             
imgraph.watershed(          imgraph.gradient(

Most packages then provide a testme() function to quickly see what it does:

> imgraph.testme()

Checkout the demos & tutorials

$ cd demos

this repo contains demos, and tutorials to get started. Looking at the code is the best way to get there!


If you would like to develop one of the submodules you should check out the master branch of that module:

$ cd nnx
$ git checkout master
$ git pull

This puts you at the head of development for that submodule, and in the proper branch to commit any changes you make to the git repository for that module. To check out all the submodules in developer mode we have added the script :

$ ./

a simple command to repeat a git command to all subdirectories


./ <command(s)>


  • switch all submodules to the master branch ./ checkout master
  • pull updates for all submodules ./ pull
  • other useful ./ status ./ diff

WARNING: will blindly send command(s) to git in each directory

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more