Deep Learning Libraries

Slides:



Advertisements
Similar presentations
GPU Architecture and Programming
Advertisements

CUDA Basics. Overview What is CUDA? Data Parallelism Host-Device model Thread execution Matrix-multiplication.
Bassem Makni SML 16 Click to add text 1 Deep Learning of RDF rules Semantic Machine Learning.
Comparing TensorFlow Deep Learning Performance Using CPUs, GPUs, Local PCs and Cloud Pace University, Research Day, May 5, 2017 John Lawrence, Jonas Malmsten,
TensorFlow The Deep Learning Library You Should Be Using.
Welcome deep loria !.
TensorFlow CS 5665 F16 practicum Karun Joseph, A Reference:
TensorFlow– A system for large-scale machine learning
Deep Learning Software: TensorFlow
John Canny Where to put block multi-vector algorithms?
Analysis of Sparse Convolutional Neural Networks
Zheng ZHANG 1-st year PhD candidate Group ILES, LIMSI
CSE 190 Caffe Tutorial.
Benchmarking Deep Learning Inference
Big Data A Quick Review on Analytical Tools
Tensorflow Tutorial Homin Yoon.
Deep Learning.
CS 6825: Deep Learning and CNN
Lecture 3. Fully Connected NN & Hello World of Deep Learning
Why it is Called Tensor Flow Parallelism in ANNs Project Ideas and Discussion Glenn Fung Presents Batch Renormalizating Paper.
Deep Learning in HEP Large number of applications:
Applications of Deep Learning and how to get started with implementation of deep learning Presentation By : Manaswi Advisor : Dr.Chinmay.
Deep Learning Platform as a Service
Intro to NLP and Deep Learning
CS 224S: TensorFlow Tutorial
Inception and Residual Architecture in Deep Convolutional Networks
Intelligent Information System Lab
Mini Presentations - part 2
Detecting personality based on interactions with Alexa
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
Overview of TensorFlow
A VERY Brief Introduction to Convolutional Neural Network using TensorFlow 李 弘
Comparison Between Deep Learning Packages
First Steps With Deep Learning Course.
Policy Compression for MDPs
TensorFlow and Clipper (Lecture 24, cs262a)
Introduction to CuDNN (CUDA Deep Neural Nets)
A brief introduction to neural network
Torch 02/27/2018 Hyeri Kim Good afternoon, everyone. I’m Hyeri. Today, I’m gonna talk about Torch.
Introduction to Deep Learning for neuronal data analyses
Tensorflow in Deep Learning
INF 5860 Machine learning for image classification
Deep Learning Packages
Introduction to Tensorflow
An open-source software library for Machine Intelligence
Deep Neural Network Toolkits: What’s Under the Hood?
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Introduction to Deep Learning with Keras
Smart Robots, Drones, IoT
MNIST Dataset Training with Tensorflow
CSC 578 Neural Networks and Deep Learning
Generative Adversarial Network
Deep Learning and Mixed Integer Optimization
Neural Networks Geoff Hulten.
Vinit Shah, Joseph Picone and Iyad Obeid
Overview of Neural Network Architecture Assignment Code
Debugging Dataflow Graphs using TensorFlow Debugger.
Artificial Neural Networks
Tensorflow Tutorial Presented By :- Ankur Mali
Keras.
TensorFlow: A System for Large-Scale Machine Learning
Deep Learning Libraries
Tensorflow and Keras (draft)
What's New in eCognition 9
CSC 578 Neural Networks and Deep Learning
Algorithms in Bioinformatics
An introduction to neural network and machine learning
Overall Introduction for the Lecture
Patterson: Chap 1 A Review of Machine Learning
Machine Learning for Cyber
Presentation transcript:

Deep Learning Libraries Giuseppe Attardi

General DL Libraries Theano Tensorflow Pytorch Caffe Keras

Caffe Deep Learning framework from Berkeley focus on vision coding in C++ or Python Network consists in layers: layer = { name = “data”, …} layer = { name = “conv”, ...} data and derivatives flow through net as blobs

Theano Python linear algebra compiler that optimizes symbolic mathematical computations generating C code integration with NumPy transparent use of a GPU efficient symbolic differentiation

Example creates symbolic variable >>> x = theano.dscalar('x') >>> y = x ** 2 >>> gy = theano.grad(y, x) >>> f = theano.function([x], gy) >>> f(4) array(8.0) looks like a normal expression

2-layer Neural Network z1 = X.dot(W1) + b1 # first layer a1 = tanh(z1) # activation z2 = a1.dot(W2) + b2 # second layer y_hat = softmax(z2) # output probabilities # class prediction prediction = T.argmax(y_hat, axis=1) # the loss function to optimize loss = categorical_crossentropy(y_hat, y).mean()

Gradient Descent dW2 = T.grad(loss, W2) db2 = T.grad(loss, b2) dW1 = T.grad(loss, W1) db1 = T.grad(loss, b1) gradient_step = theano.function([X, y], updates = ((W2, W2 – learn_rate * dW2), (W1, W1 – learn_rate* dW1), (b2, b2 – learn_rate* db2), (b1, b1 – learn_rate* db1)))

Training loop # Gradient descent. For each batch... for i in xrange(0, epochs): # updates parameters W2, b2, W1 and b1! gradient_step(train_X, train_y)

TensorFlow C++ core code using Eigen Eigen template metaprogramming linear algebra generates code for CPU or GPU Build architecture as dataflow graphs: Nodes implement mathematical operations, or data feed or variables Nodes are assigned to computational devices and execute asynchronously and in parallel Edges carry tensor data between nodes

Training Gradient based machine learning algorithms Automatic differentiation Define the computational architecture, combine that with your objective function, provide data -- TensorFlow handles computing the derivatives

Performance Support for threads, queues, and asynchronous computation TensorFlow allows assigning graph to different devices (CPU or GPU)

Keras

Keras Keras is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano. Guiding principles User friendlyness, modularity, minimalism, extensibility, and Python-nativeness. Keras has out-of-the-box implementations of common network structures: convolutional neural network Recurrent neural network Runs seamlessly on CPU and GPU.

Outline Install Keras Preprocess input Define model Compile model Import libraries Load image data Preprocess input Define model Compile model Fit model on training data Evaluate model

Install Keras Full instructions Basic instructions: Install backend: Tensorflow or Theano > pip install keras

30 sec. example from keras.models import Sequential from keras.layers import Dense model = Sequential() model.add(Dense(units=64, activation='relu', input_dim=100)) model.add(Dense(units=10, activation='softmax')) model.compile(loss='categorical_crossentropy', optimizer='sgd', metrics=['accuracy']) model.compile(loss=keras.losses.categorical_crossentropy, optimizer=keras.optimizers.SGD(lr=0.01, momentum=0.9, nesterov=True)) model.fit(x_train, y_train, epochs=5, batch_size=32) classes = model.predict(x_test, batch_size=128)

Keras Tutorial Run tutorial at: http://attardi-4.di.unipi.it:8000/user/attardi/notebooks/MNIST/MNIST%20in%20Keras.ipynb

DeepNL Deep Learning library for NLP C++ with Eigen Wrapper for Python, Java, PHP automatically generated with SWIG Git repository