基于CUDA的卷积神经网络算法实现
摘 要
卷積神經網絡是近年來人工智能領域取得重大突破的一種重要手段,給出了圖像識別、語音識別和自然語言處理領域中關鍵問題的優化解決方案,尤其適合處理圖像方面的任務,如人臉識別和手寫體識別。手寫數字識別是用卷積神經網絡解決的經典問題,采用一般方法訓練出來的神經網絡達到了97%的識別率,幾乎與人類的識別精度一致,但在執行速度上沒有人類識別得快。在實際商業應用中不可避免地會遇到數據量過大的問題,如在手寫數字識別中有60000條規格為28*28單位像素的訓練樣本需要訓練,這樣會導致執行速度較慢,CPU在處理這樣包含大量高精度浮點數的任務時,其消耗的時間是不可接受的,在訓練期要花費數小時的時間。
針對上述問題,該文將構建基于CUDA架構的編程環境,采用CUDA/C++編程實現卷積神經網絡算法,將卷積神經網絡算法應用于手寫數字識別問題中,在選擇合適的網絡模型和相關參數的情況下,利用GPU的高度并發性能,提高卷積神經網絡訓練數據的速度。通過對GPU實現和CPU實現進行對比實驗,驗證對卷積神經網絡算法進行CUDA并行化訓練和識別是可行有效的,實驗表明在普通PC機上采用GPU實現的卷積神經網絡算法比CPU實現的卷積神經網絡算法雖然在準確率上僅提升了0.29%,但在速度上加快了15%。
關鍵詞:CUDA,卷積神經網絡,深度學習,并行計算
ABSTRACT
Convolutional neural network is a major breakthrough in the field of artificial intelligence in recent years, an important means of image recognition given to optimize speech recognition and natural language processing solutions, especially for process images tasks, such as human face recognition and handwriting recognition. Handwritten numeral recognition is a classic problem with the convolutional neural network to solve, using the general method of trained neural network reaches 97% recognition rate, with almost the same human recognition accuracy, but the speed of execution without human recognition quickly. In practical commercial applications will inevitably encounter the problem of data overload, as there are 60,000 training sample size is 28 * 28 pixel units need to be trained in digital handwriting recognition, this will result in slower performance, CPU in when processing tasks such contains a lot of high-precision floating-point number, the elapsed time is unacceptable, in the training period to spend a few hours.
To solve these problems, this paper will build a CUDA architecture-based programming environment using CUDA / C ++ programming to implement the convolution neural network algorithm. The convolution neural network algorithm is applied to handwritten numeral recognition problem. After selecting an appropriate network model and related parameters, the use of highly concurrent GPU performance,convolution neural network training to improve the speed of data. Then use the model to achieve the GPU and CPU to complete some comparative tests to verify the fact that using the CUDA to parallel implementing convolution neural network algorithm for training and recognition is feasible and effective,experiments show that on the common PC the neural network algorithm convolution convolution neural network algorithm to achieve GPU than CPU implementations on the speed by 15%, on the accuracy improved 0.29%.
Key words:CUDA, CNN, Deep Learning, Parallel Computing
源碼下載地址:https://www.write-bug.com/article/1773.html
總結
以上是生活随笔為你收集整理的基于CUDA的卷积神经网络算法实现的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python编程剪刀石头布思路_剪刀石头
- 下一篇: html div 边框只显示右侧,div