Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

This presentation about CAFFE usage with CUDA.

Published in: Software
  • I like this service ⇒ ⇐ from Academic Writers. I don't have enough time write it by myself.
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ ❶❶❶
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here


  1. 1. CUDA & CAFFE Использование CUDA и CAFFE для создания глубоких нейронных сетей Babii A.S. -
  2. 2. Why we need to learn methods of ‘deep learning’
  3. 3. Deep learning for image recognition tasks Image classification Object detection and localization Object class segmentation
  4. 4. Problems related with dataset size What if we have a large dataset?
  5. 5. What about types of parallel computing? GPU - specific CPU - specific
  6. 6. Optimization table for matrix multiplication[1] 1. Saman Amarasinghe, Matrix Multiply, a case study – 2008.
  7. 7. If no parallelization, but we want to make it faster 1. Use profiler(gprof, valgrind, … ) 2. Does application using BLAS? 3. Use vector or matrix form of data representation and include BLAS 4. SIMD – if no other way… use it for maximum perfomance on 1 core
  8. 8. Бабий А.С. - How to make it parallel?. 1. KML, PBLAS, ATLAS 2. Когда CPU Multicore эффективнее GPU ? 3. NVIDIA CUDA. 4. OpenCL
  9. 9. CUDA
  10. 10. Deep convolutional neural networks, CAFFE implementation ConvNet configuration by Krizhevsky [2]
  11. 11. Deep convolutionnetwork example Convolution Neural Network Architecture Model[3] Feature maps
  12. 12. Convolution & pooling http://www.son
  13. 13. Набор примитивов для сетей Deep Learning 1. Сверточный слой 2. Слой фильтрации 3. Обобщающий слой Интеграция с Caffe 24-core Intel E5-2679v2 CPU @ 2.4GHz vs K40, NVIDIA
  14. 14. Feature maps Feature map [4] Накладываем друг на друга но, с «коэффициентом прозрачности»
  15. 15. Библиотеки для работы с deep learning Caffe – deep convolutional neural network framework ConvNetJS – JS based deep learning framework DL4J - Java based deep learning framework Theano – CPU/GPU symbolic expression compiler in python Cuda-Convnet – A fast C++/CUDA implementation of convolutional (or more generally, feed-forward) neural networks Torch – provides a Matlab-like environment for state-of-the-art machine learning algorithms in lua Accord.NET - C# deep learning, tutorial:
  16. 16. Работа с CAFFE Начинать лучше с утилит командной строки: build/tools Наиболее доступный пример на базе MNIST – распознавания рукописных цифр cd $CAFFE_ROOT ./data/mnist/ ./examples/mnist/ cd $CAFFE_ROOT ./examples/mnist/
  17. 17. В каком виде подаются входные и выходные данные? - databases (LevelDB or LMDB) - directly from memory - from files on disk in HDF5 - common image formats. Input data Output data -snapshot file with mode -snapshot file with solver state Solver? Yes, we can continue breacked training from snapshot
  18. 18. Виды слоев CAFFE Caffe stores and communicates data in 4-dimensional arrays called blobs name: "LogReg" layers { name: "mnist" type: DATA top: "data" top: "label" data_param { source: "input_leveldb" batch_size: 64 } } layers { name: "ip" type: INNER_PRODUCT bottom: "data" top: "ip" inner_product_param { num_output: 2 } } layers { name: "loss" type: SOFTMAX_LOSS bottom: "ip" bottom: "label" top: "loss" }
  19. 19. Виды слоев Convolutional layer Required field num_output (c_o): the number of filters kernel_size (or kernel_h and kernel_w): specifies height and width of each filter Pooling layer Required kernel_size (or kernel_h and kernel_w): specifies height and width of each filter Loss Layers, Activation / Neuron Layers, Data Layers, Common Layers How to configure? Ready to use models in folder: examples
  20. 20. Решение своей задачи 1. Заботимся о корректности, размере и покрытии выборок. 2. Компилируем Caffe с поддержкой GPU. 3. Конфигурируем сеть, отталкиваясь от примеров. 4. Тренируем, смотрим на результат тестовой выборки. 5. Если результат не устраивает- настраиваем и тренируем до получения достаточного результата 6. Для использования натренированной сети для одиночных Изображений необходимо написать конфиг и воспользоваться C++, Python или Mathlab.
  21. 21. References 1. L. Deng and D. Yu, "Deep Learning: Methods and Applications“ SIG-039.pdf 2. ConvNet configuration by Krizhevsky et al 3. Efficient mapping of the training of Convolutional Neural Networks to a CUDA-based cluster 4. 5. Спасибо за внимание !