View on GitHub

Torch7

Scientific computing for LuaJIT.

About Torch7

Torch7 is a scientific computing framework with wide support for machine learning algorithms. It is easy to use and provides a very efficient implementation, thanks to an easy and fast scripting language, LuaJIT, and an underlying C implementation.

Among other things, it provides: To get an overview of the Torch7 ecosystem, check this page.

Mailing List

If you have questions or need support, use our mailing list:

Installation

The easiest way to install Torch is to run these two commands:

$ curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
$ curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-luajit+torch | bash

The first script installs basic dependencies / libraries that LuaJIT and Torch require. The second script installs LuaJIT, Luarocks, and then uses Luarocks to install Torch and a few common/useful packages. These scripts work on Ubuntu >= 12.04 and OSX >= 10.8.

You can look at them to see exactly what they do: dependency script and luajit+torch+extra script.

Torch, and all its related packages, are now distributed as simple Luarocks packages. It only requires LuaJIT (>= 2.0) and Luarocks (>= 2.0.12) :

If you install Luajit and Luarocks yourself, you'll have to specify the URL to our rock server, to find Torch. We recommend you either use the script above to automate that process.

$ luarocks --version
Luarocks 2.0.12

$ luajit -v
LuaJIT 2.0.2 -- Copyright (C) 2005-2013 Mike Pall. http://luajit.org/

$ luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install torch

Other packages can be installed the same way, using Luarocks:

$ luarocks --server=https://raw.githubusercontent.com/torch/rocks/master install image
$ luarocks --server=https://raw.githubusercontent.com/torch/rocks/master list

Once installed you can run torch with the command "th" from you prompt!

Packages

Torch used to be distributed as a single repo, which provided a few default packages. These packages, along with their documentation, are now each hosted on their own Github repository. Here is the list of official Torch packages:

Package Doc Description
torch doc numeric library, n-dim array, linear algebra routines ...
nn doc modular neural network framework
optim doc numeric optimization routines (SGD, L-BFGS, CG, ...)
gnuplot doc interface to gnuplot, for plots/graphics
cutorch N/A Torch for CUDA
cunn N/A nn for CUDA
paths doc paths, file system
image N/A image transform routines, color spaces, I/O, ...
trepl doc pure Lua REPL - installs a "th" binary with better completion, history, ...
cwrap doc automatic C wrapper for Lua
qtlua doc QT for Lua

More packages can be found on Torch's Github portal and on this summary page.

Even more packages can be found using Luarocks:

$ luarocks --server=https://raw.githubusercontent.com/torch/rocks/master search --all

See the list of rocks we're hosting here.

Credits

Torch7 is developed at Idiap Research Institute, New York University and NEC Laboratories America.

At this time, Torch7 is maintained by Ronan Collobert (the dictator), Clément Farabet (the chemist), and Koray Kavukcuoglu (Dr Jeykyll).

We also use the great Qt Lua interface from Leon Bottou: QtLua.

If you use Torch7 for your work, please cite the following paper: R. Collobert, K. Kavukcuoglu and C. Farabet. Torch7: A Matlab-like Environment for Machine Learning. In BigLearn, NIPS Workshop, 2011.

License

Torch7 is distributed under a BSD license. It runs on Linux, FreeBSD and MacOS X. Core packages also work on Windows.

Legacy

The very old Torch3 and Torch5 versions are still available here and there, should you need them.