CUDA编程实践--cuDNN

NVIDIA® cuDNN is a GPU-accelerated library of primitives for deep neural networks.
cuDNN是一个对DNN的GPU加速库。他提供高度可调整的在DNN中的常用的例程实现。
It provides highly tuned implementations of routines arising frequently in DNN applications:

  • 常用语前向后向卷积网络,包括交叉相关。Convolution forward and backward, including cross-correlation
  • 前像后向pooling。Pooling forward and backward
  • 前向后向softmax。Softmax forward and backward
  • 前向后向神经元激活。Neuron activations forward and backward
  • Rectified linear (ReLU)
  • Hyperbolic tangent (TANH)
  • Tensor transformation functions
  • LRN, LCN and batch normalization forward and backward

cuDNN’s convolution routines aim for performance competitive with the fastest GEMM (matrix multiply) based implementations of such routines while using significantly less memory.
cuDNN突出可定制的数据布局,支持灵活的维数排序,跨步,4D子区域for 4D张量作为输入输出。
cuDNN features customizable data layouts, supporting flexible dimension ordering, striding, and subregions for the 4D tensors used as inputs and outputs to all of its routines. This flexibility allows easy integration into any neural network implementation and avoids the input/output transposition steps sometimes necessary with GEMM-based convolutions.
cuDNN offers a context-based API that allows for easy multithreading and (optional) interoperability with CUDA streams.
cuDNN提供一种基于上下文的API,允许简单的多线程和CDUA流的互用。

卷积神经网络的组成层

在卷积神经网络中,有3种最主要的层:

  • 卷积运算层
  • pooling层
  • 全连接层

一个完整的神经网络就是由这三种层叠加组成的。
局部关联细节。我们刚才说到卷积层的局部关联问题,这个地方有一个receptive field,也就是我们直观理解上的『滑动数据窗口』。从输入的数据到输出数据,有三个超参数会决定输出数据的维度,分别是深度/depth,步长/stride 和 填充值/zero-padding:

  • 所谓深度/depth,简单说来指的就是卷积层中和上一层同一个输入区域连接的神经元个数。这部分神经元会在遇到输入中的不同feature时呈现activate状态,举个例子,如果这是第一个卷积层,那输入到它的数据实际上是像素值,不同的神经元可能对图像的边缘。轮廓或者颜色会敏感。
  • 所谓步长/stride,是指的窗口从当前位置到下一个位置,『跳过』的中间数据个数。比如从图像数据层输入到卷积层的情况下,也许窗口初始位置在第1个像素,第二个位置在第5个像素,那么stride=5-1=4.
  • 所谓zero-padding是在原始数据的周边补上0值的圈数

CNN细说卷积神经网络
Convolutional Neural Networks (CNNs / ConvNets)
cuda-convnet2

你可能感兴趣的:(CUDA)