Summary
Chainer is a Python*-based deep learning framework aiming at flexibility and intuition. It provides automatic differentiation APIs based on the define-by-run approach (a.k.a. dynamic computational graphs) as well as object-oriented high-level APIs to build and train neural networks. It supports various network architectures including feed-forward nets, convnets, recurrent nets and recursive nets. It also supports per-batch architectures. Forward computation can include any control flow statements of Python without lacking the ability of backpropagation. It makes code intuitive and easy to debug. IntelChainer, which is optimized for Intel® architecture is currently integrated with the latest release of Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) 2017 optimized for Intel® Advanced Vector Extensions 2 (Intel® AVX) and Intel® Advanced Vector Extensions 512 (Intel®AVX-512) instructions which are supported in Intel® Xeon® and Intel® Xeon Phi™ processors.
Recommended Environments
We recommend these Linux* distributions.
- Ubuntu* 14.04/16.04 LTS 64bit
- CentOS* 7 64bit
The following versions of Python can be used:
- 2.7.5+, 3.5.2+, and 3.6.0+
Above recommended environments are tested. We cannot guarantee that IntelChainer works on other environments including Windows* and macOS*, even if IntelChainer looks running correctly.
Dependencies
Before installing IntelChainer, we recommend to upgrade setuptools if you are using an old one:
$ pip install -U setuptools
The following packages are required to install Chainer.
- NumPy 1.9, 1.10, 1.11, 1.12, 1.13
- Six 1.9+
- Swig 3.0.9+
Image dataset support
- pillow 2.3+
HDF5 serialization support
- h5py 2.5+
Testing utilities
- pytest 3.2.5+
Intel® MKL-DNN
- You don’t need to manually install Intel MKL-DNN, when build IntelChainer, Intel MKL-DNN will be downloaded and built automatically, thus, boost, glog and gflags are also required.
Installation
Currently, master_v3 is the most stable version. You can use setup.py to install IntelChainer from the tarball:
$ git clone -b master_v3 https://github.com/intel/chainer $ cd chainer $ python setup.py install
Use pip to uninstall Chainer:
$ pip uninstall chainer
Run with Docker*
We provide the Dockerfile for Ubuntu and Centos in chainer/docker directory based on python2 and python3, respectively. Links see:
https://github.com/intel/chainer/blob/master_v3/docker/python2/Dockerfile_ubuntu
https://github.com/intel/chainer/blob/master_v3/docker/python3/Dockerfile_ubuntu
https://github.com/intel/chainer/blob/master_v3/docker/python2/Dockerfile_centos
https://github.com/intel/chainer/blob/master_v3/docker/python3/Dockerfile_centos
You can refer to following wiki to check how to build/run with docker. Even if you don’t want to play with docker, you can also refer to those docker files to learn how to build IntelChainer environment for Ubuntu and Centos based on python2 and python3.
https://github.com/intel/chainer/wiki/How-to-build-and-run-Intel-Chainer-Docker-image
Training Examples
Training test with mnist dataset:
$ cd examples/mnist $ python train_mnist.py -g -1
Training test with cifar datasets:
- run the CIFAR-100 dataset:
$ cd examples/cifar $ python train_cifar.py –g -1 --dataset='cifar100'
- run the CIFAR-10 dataset:
$ cd examples/cifar $ python train_cifar.py –g -1 --dataset='cifar10'
Single Node Performance Test Configurations
For Single Node Performance Test Configurations, please refer to following wiki:
https://github.com/intel/chainer/wiki/Intel-Chainer-Single-Node-Performance-Test-Configurations
License
MIT License (see LICENSE file).
Reference
Tokui, S., Oono, K., Hido, S. and Clayton, J., Chainer: a Next-Generation Open Source Framework for Deep Learning,Proceedings of Workshop on Machine Learning Systems(LearningSys) in The Twenty-ninth Annual Conference on Neural Information Processing Systems (NIPS), (2015) URL, BibTex
More Information
- Official site: http://chainer.org/
- Official document: http://docs.chainer.org/
- Pfn chainer github: https://github.com/pfnet/chainer
- Intel chainer github: https://github.com/intel/chainer
- Forum: https://groups.google.com/forum/#!forum/chainer
- Forum (Japanese): https://groups.google.com/forum/#!forum/chainer-jp
- Twitter: https://twitter.com/ChainerOfficial
- Twitter (Japanese): https://twitter.com/chainerjp
- External examples: https://github.com/pfnet/chainer/wiki/External-examples
- Research projects using Chainer: https://github.com/pfnet/chainer/wiki/Research-projects-using-Chainer