Constructing deepnet Depth Learning Framework __linux Linux Environment

Source: Internet
Author: User
Tags nets cuda toolkit

As a result of the project requirements of the laboratory, the use of RBM (limited Boltzmann machine), DBN (confidence degree network) and other in-depth learning network model, so the study and use of Toronto University to provide a deepnet depth learning framework.
Deepnet is a framework for using Python to implement some depth learning algorithms based on GPU, developed by Dr. Nitish Srivastava of Toronto University, including the following depth learning algorithms:
1.feed-forward Neural Nets
2.Restricted Boltzmann Machines
3.Deep Belief Nets
4.Autoencoders
5.Deep Boltzmann Machines
6.Convolutional Neural Nets

The implementation of the framework requires the support of Cudamat and cuda-convnet.
The following will be shared by the process of building a deepnet depth learning framework in a Linux environment.

The 1.Linux version is Ubuntu16.04.

2. Download and install Python.
Python uses Anaconda2 4.4.1, because it integrates many of the python's Third-party Libraries for computing, and is handy to add Anaconda2 environment variables to ~/.BASHRC files.

CD/HOME/PB
Vi./BASHRC
Add in the most downward
Export path= "/home/pb/anaconda2/bin: $PATH"

3.CUDA installation.
Our GPU is GTX1080, official online download CUDA8.0, download address: Https://developer.nvidia.com/cuda-toolkit, after installing CUDA Toolkit and SDK, add related environment variables to ~/. BASHRC the file.
Export Cuda_bin=/usr/local/cuda-8.0/bin
export cuda_lib=/usr/local/cuda-8.0/lib64
export Path=${cuda_bin} : $PATH
Export Ld_library_path=${cuda_lib}: $LD _library_path

4.Google Protocol buffers installation.
We are using release version, address for https://github.com/google/protobuf/releases, find the corresponding version, we are using Protoc-3.1.0-linux-x86_64.zip. After the download is unpacked, place the PROTOC in the bin directory in the/usr/local/bin/, and put the Google folder in the Include directory to/usr/local/inculde/. Then add the relevant environment variables to the good.
Export path= "/usr/local/bin: $PATH"
Test protocol buffers is installed to use the following command:
Protoc-version
will appear:
Libprotoc 3.1.0

5. Basic environment variables have been configured, now download deepnet, download the address: https://github.com/nitishsrivastava/deepnet
Download after decompression contains three folders: Cudamat,deepnet,eigenmat
The Deepnet folder contains Python code such as training, visualization, and the basic network and corresponding layers.
The primary file in the Eigenmat folder is eigenmat.cc, and the model calls Eigenmat when the CPU is used for training.
The main file in the Cudamat folder is Cudamat.cu, and when training is using the GPU, the model calls Cudamat.
The specific content will be presented in a later article.

6. Compile Cudamat.
CD Cudamat make

7. Compile Eigenmat.
Need to install Eigen, the official website to download extract to the root directory, add the corresponding environment variables, and then to the/eigenmat directory, make good. The need to use the CPU is this step, because we are using a GPU, the CPU is not used, so skip this step.

8. Add deepnet the corresponding environment variable.
Export ld_library_path= $LD _library_path:$/home/pb/deepnet-master/cudamat
export pythonpath= $PYTHONPATH:/home /pb/deepnet-master
If you use the CPU, you also need to add the Eigenmat directory to the environment variable.

9. Test Deepnet.
Download mnist data set, download address: http://www.cs.toronto.edu/~nitish/deepnet/mnist.tar.gz
To run the CD to the Deepnet/deepnet/examples directory:
Python setup_examples.py <path to mnist dataset> <output path>
This sentence is primarily to configure the path of the dataset and the output path, and then go to any folder in the/deepnet/examples, such as/HOME/PB/DEEPNET-MASTER/DEEPNET/EXAMPLES/RBM:
./runall.sh
This begins to train the RBM model.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.