CSE 190 Caffe Tutorial.

Slides:



Advertisements
Similar presentations
Lecture 5: CNN: Regularization
Advertisements

Lecture 2: Caffe: getting started Forward propagation
ImageNet Classification with Deep Convolutional Neural Networks
Lecture 4: CNN: Optimization Algorithms
Lecture 3: CNN: Back-propagation
Brewing Deep Networks With Caffe
ECE6504 – Deep Learning for Perception
Backpropagation An efficient way to compute the gradient Hung-yi Lee.
11 1 Backpropagation Multilayer Perceptron R – S 1 – S 2 – S 3 Network.
Deep learning using Caffe
Convolutional Neural Network
Lecture 1c: Caffe - Getting Started
Introduction to Convolutional Neural Networks
Deep Learning Overview Sources: workshop-tutorial-final.pdf
Assignment 4: Deep Convolutional Neural Networks
Lecture 2c: Caffe: Training of CIFAR-10
Lecture 2b: Convolutional NN: Optimization Algorithms
Lecture 3a Analysis of training of NN
Understanding Convolutional Neural Networks for Object Recognition
Lecture 7 Learned feedforward visual processing
TensorFlow CS 5665 F16 practicum Karun Joseph, A Reference:
Analysis of Sparse Convolutional Neural Networks
RNNs: An example applied to the prediction task
Convolutional Neural Network
Chilimbi, et al. (2014) Microsoft Research
Computer Science and Engineering, Seoul National University
Matt Gormley Lecture 16 October 24, 2016
CSCI 5922 Neural Networks and Deep Learning: Convolutional Nets For Image And Speech Processing Mike Mozer Department of Computer Science and Institute.
Deep Learning Libraries
LARS Background Reference Paper: Reference Patch in Intel Caffe
Overview of TensorFlow
Lecture 5 Smaller Network: CNN
Efficient Deep Model for Monocular Road Segmentation
First Steps With Deep Learning Course.
Machine Learning: The Connectionist
Introduction to CuDNN (CUDA Deep Neural Nets)
PipeDream: Pipeline Parallelism for DNN Training
Torch 02/27/2018 Hyeri Kim Good afternoon, everyone. I’m Hyeri. Today, I’m gonna talk about Torch.
Fully Convolutional Networks for Semantic Segmentation
Layer-wise Performance Bottleneck Analysis of Deep Neural Networks
RNNs: Going Beyond the SRN in Language Prediction
Brewing Deep Networks With Caffe
Introduction to Neural Networks
Deep Learning Packages
Lecture 11. MLP (III): Back-Propagation
Counting in Dense Crowds using Deep Learning
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Logistic Regression & Parallel SGD
Very Deep Convolutional Networks for Large-Scale Image Recognition
Smart Robots, Drones, IoT
A Proposal Defense On Deep Residual Network For Face Recognition Presented By SAGAR MISHRA MECE
LECTURE 35: Introduction to EEG Processing
Convolutional networks
Neural Networks Geoff Hulten.
Lecture: Deep Convolutional Neural Networks
LECTURE 33: Alternative OPTIMIZERS
Overview of Neural Network Architecture Assignment Code
Forward and Backward Max Pooling
RNNs: Going Beyond the SRN in Language Prediction
Backpropagation Disclaimer: This PPT is modified based on
Artificial Intelligence 10. Neural Networks
Image Classification & Training of Neural Networks
CSCI 5922 Neural Networks and Deep Learning: Convolutional Nets For Image And Speech Processing Mike Mozer Department of Computer Science and Institute.
Deep Learning Libraries
CS295: Modern Systems: Application Case Study Neural Network Accelerator Sang-Woo Jun Spring 2019 Many slides adapted from Hyoukjun Kwon‘s Gatech “Designing.
VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION
Image recognition.
Dhruv Batra Georgia Tech
Principles of Back-Propagation
Overall Introduction for the Lecture
Presentation transcript:

CSE 190 Caffe Tutorial

Summary Caffe is a deep learning framework Define a net layer-by-layer Define the whole model from input-to-loss Data and derivatives flow through net during forward/backward passes Information is stored, communicated and manipulated as blobs Blobs are a unified memory interface for holding data (data, model parameters, derivatives) A blob is a N-dimensional array stored in a C-contiguous fashion

Caffe: Main classes SoftmaxLossLayer fc1 InnerProductLayer X DataLayer Blob: Stores data and derivatives Layer: Transforms bottom blobs to top blobs Net: Many layers; computes gradients via forward / backward Solver: Uses gradients to update weights fc1 data data diffs InnerProductLayer W b data data data X diffs diffs DataLayer

Blob Blobs are N-D arrays for storing and communicating information. name: "conv1" type: CONVOLUTION bottom: "data" top: "conv1" … definition … Blobs are N-D arrays for storing and communicating information. hold data, derivatives, and parameters lazily allocate memory shuttle between CPU and GPU top blob bottom blob Data Number x K Channel x Height x Width 256 x 3 x 227 x 227 for ImageNet train input Parameter: Convolution Weight N Output x K Input x Height x Width 96 x 3 x 11 x 11 for CaffeNet conv1 Parameter: Convolution Bias 96 x 1 x 1 x 1 for CaffeNet conv1

Layer Layers are the essence of the model (convolutions, pooling, fully-connected, etc.) Input: bottom Output: top Critical computations: setup forward backward Setup: initialize the layer and connections Forward: Given input from bottom, compute output and send to top Backward: Given gradient w.r.t. top output, compute the gradient w.r.t. the input and send to the bottom

Net A network is a set of layers and their connections: LogReg ↑ LeNet → ImageNet, Krizhevsky 2012 → A network is a set of layers and their connections: name: "dummy-net" layer { name: "data" …} layer { name: "conv" …} layer { name: "pool" …} … more layers … layer { name: "loss" …} Caffe creates and checks the net from the definition. Data and derivatives flow through the net as blobs – an array interface

Protocol Buffers Like strongly typed, binary JSON Developed by Google Define message types in .proto file Define messages in .prototxt or .binaryproto files (Caffe also uses .caffemodel) JSON: JavaScript Object Notation

Prototxt: Define Net

Prototxt: Define Net Layers and Blobs often have same name!

Prototxt: Define Net Layers and Blobs often have same name! Learning rates (weight + bias) Regularization (weight + bias)

Prototxt: Define Net Layers and Blobs often have same name! Number of output classes Learning rates (weight + bias) Regularization (weight + bias)

Solver Prototxt Optimization like model definition is configuration. train_net: "lenet_train.prototxt" base_lr: 0.01 momentum: 0.9 weight_decay: 0.0005 max_iter: 10000 snapshot_prefix: "lenet_snapshot" All you need to run things on the GPU. > caffe train -solver lenet_solver.prototxt -gpu 0 Stochastic Gradient Descent (SGD) + momentum · Adaptive Gradient (ADAGRAD) · Nesterov’s Accelerated Gradient (NAG)

Recipe for Brewing Convert the data to Caffe-format Define the Net lmdb, leveldb, hdf5 / .mat, list of images, etc. Define the Net Configure the Solver caffe train -solver solver.prototxt -gpu 0 Examples are your friends caffe/examples/mnist,cifar10,imagenet caffe/examples/*.ipynb caffe/models/*