Deep Learning is a popular kid in machine learning these days.
At Facebook AI Research we've been doing quite a bit of deep learning research.
This repository contains our highly engineered deep learning modules for GPUs, to accelerate your own deep learning endeavours.
It plugs into the Torch-7 framework and installs seamlessly via luarocks
,
and is fully compatible with torch's nn package.
In summary, we're releasing fast nn modules for Convnets and neural networks in general:
- Fast spatial convolution module that uses FFT to accelerate convolutions. We wrote a paper about them if you'd like to read more.
- Fast Temporal convolutions that are 1.5x to 10x faster compared to Torch's cunn implementations.
- nn.DataParallel and nn.ModelParallel containers. Plug your model in them and see it accelerate over multiple GPUs
- Wrappers to use FFT/IFFT as nn modules.
- Fast LookupTable that is used for Neural Language Models and word embeddings. Much faster than the one in torch/nn
- Hierarchical SoftMax module, now classifying 1 million classes is a practically viable strategy
- LP and Max Pooling over feature maps.
- more goodies. Full documentation and spec is here: https://facebook.github.io/fbcunn/fbcunn/
We love open science and open source. In short, we love sharing. We publish our research there. We share our code right here!
You use Torch for your neural networks and deep learning research, or you work with another machine learning package but you like fast code regardless.
- Find a machine with Ubuntu 14.04+ and an NVIDIA GPU with compute capability 3.5 or above, as well as CUDA 6.5.
- Install Torch-7. It's awesome.
- Install folly, fbthrift, thpp and fblualib by running this simple script. Take a lunch break, this takes some time, compiling and all...
- That's it, now install fbcunn:
git clone https://github.com/soumith/fbcunn.git
cd fbcunn && luarocks make rocks/fbcunn-scm-1.rockspec # got get a coffee
We've worked hard to make the install as pain-free as possible. If you have an issue, use github issues, we'll try our best to help.
- The DataParallel and ModelParallel modules are super-simple to use. The unit-test doubles as both an example as well as a test. If you want more examples, please do ask.
m = nn.DataParallel():add(nn.SpatialConvolution(...)):add(nn.ReLU()) -- see, so simple
- Convolution modules are even simpler to use. They are fully API compatible with their nn equivalents
conv = nn.SpatialConvolutionCuFFT(...) -- fast spatial convolutions!
conv = nn.TemporalConvolutionFB(...) -- fast temporal convolutions!
- LookupTable is named
nn.LookupTableGPU
and Hierarchical SoftMax asnn.HSM
, they are super-simple to use as well, check the docs out.
https://facebook.github.io/fbcunn/fbcunn/
The unit tests in the test/ folder also double as examples! If you have a question, do ask.
API docs - https://facebook.github.io/fbcunn/fbcunn/
Some of the unit tests need fbnn
fbcunn
is BSD-licensed. We also provide an additional patent
grant.