Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
CNN accelerated by cuda. Test on mnist and finilly get 99.76%
branch: master

fix

latest commit 9816d38844
zhxfl authored
Failed to load latest commit information.
Debug release debug config
Release release debug config
ChineseConfig.txt test on cifar-100
Cifar100Config.txt fix bug
Cifar10Config.txt fix
Config.cpp fix
Config.h fix push
MnistConfig.txt fix
README.md fix
checkPoint.txt random batch horizonal
cuMatrix.cpp fix push
cuMatrix.h fix push
cuMatrixVector.cpp fix push
cuMatrixVector.h fix push
cuTrasformation.cu fix
cuTrasformation.cuh fix
dataPretreatment.cu fix push
dataPretreatment.cuh fix push
log.txt random batch horizonal
main.cpp fix
net.cu fix
net.cuh fix
readCIFAR100Data.cpp fix push
readCIFAR100Data.h fix push
readCIFAR10Data.cpp fix push
readCIFAR10Data.h fix push
readChineseData.cpp fix push
readChineseData.h fix push
readMnistData.cpp fix push
readMnistData.h fix push
util.cpp fix batch random
util.h fix push

README.md

CUDA-CNN

Functions

CNN accelerated by cuda.
Test on mnist and get 99.7% (best 99.74%)
Test on cifar-10 and get 81.38% (best 90%)
Test on cifar-100 and get 51.13% (best 65%)


Feature

  1. Use DropConnnect to train the NetWork
  2. Support checkpoint, the program will save the best test result and save the network weight in the file "checkPoint.txt", If the program exit accidentally, you can continue the program form this checkpoint.
  3. Translate the data set of mnist, including scale, rotate, distortion.
  4. The log will be saved in the file "log.txt".
  5. In the convolutional layers, you can chose combine feature maps, according to "notes on Convolutional Neural NetWorks"

Compile

Depend on opencv and cuda
You can compile the code on windows or linux.

SDK path

  • linux: /usr/local/cuda/samples/common/inc/ (For include file "helper_cuda")
  • windows: X:/Program Files (x86) /NVIDIA Corporation/CUDA Samples/v6.5/common/inc (For include file "helper_cuda")

Library search path(-L)

  • linux: /usr/local/lib/
  • windows: X:/Program Files/opencv/vs2010/install/x86/cv10/lib (Depend on situation)

libraries(-l)

  • opencv_core
  • opencv_highgui
  • opencv_imgproc
  • opencv_imgcodecs (need for opencv3.0)
  • cublas
  • curand

GPU compute

  • capability 2.0

Windows

  1. Install vs2010.
  2. Download and install opencv-2.4 or other higher versions
  3. Download and install cuda-5.0 or other higher versions
  4. When you create a new project using VS2010, You can find NVIDIA-CUDA project template, create a cuda-project.
  5. Add the "include path" and "lib path" to the project

Linux

  1. Install opencv and cuda
  2. Start the nsight from cuda
  3. Create an 'empty cuda' project and import the clone code
  4. Add the "include path" and "lib path" to the project

Config

MNIST

#Comment#

IS_GRADIENT_CHECKING = false; #is true when debug#
BATCH_SIZE = 200; #test image size should be divided with no remainder#
NON_LINEARITY = NL_RELU; #NON_LINEARITY CAN = NL_SIGMOID , NL_TANH , NL_RELU#
CHANNELS = 1; #1, 3, 4#
CROP = 4; #0<= crop <=imgSize#
SCALE = 13.0; #13% of ImgSize#
ROTATION = 13.0; #angle#
DISTORTION = 3.5; #just for mnist#
SHOWIMAGE = false; #show the images after transformation#
HORIZONTAL = false; #horizontal reflection#
COMBINE_FEATRUE_MAPS = false; #According to paper "notes on Convolutional Neural NetWorks"#

CIFAR-10

IS_GRADIENT_CHECKING = false; #is true when debug#
BATCH_SIZE = 100; #test image size should be divided with no remainder#
NON_LINEARITY = NL_RELU; #NON_LINEARITY CAN = NL_SIGMOID , NL_TANH , NL_RELU#
CHANNELS = 3; #1, 3, 4#
CROP = 4; #0<= crop <=imgSize#
SCALE = 0.0; #13% of ImgSize#
ROTATION = 0.0; #angle#
DISTORTION = 0.0; #just for mnist#
SHOWIMAGE = false; #show the images after transformation#
HORIZONTAL = true; #horizontal reflection# COMBINE_FEATRUE_MAPS = false; #According to paper "notes on Convolutional Neural NetWorks"#


Informations

Something went wrong with that request. Please try again.