APACHE MXNET By Beni Mulyana.

Slides:



Advertisements
Similar presentations
The Assembly Language Level
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
(Page 554 – 564) Ping Perez CS 147 Summer 2001 Alternative Parallel Architectures  Dataflow  Systolic arrays  Neural networks.
Computers: Software Patrice Koehl Computer Science UC Davis.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Presented By: Muhammad Tariq Software Engineer Android Training course.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
GPU Programming Contest. Contents Target: Clustering with Kmeans How to use toolkit1.0 Towards the fastest program.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
OPERATING SYSTEMS DO YOU REQUIRE AN OPERATING SYSTEM IN YOUR SYSTEM?
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
CHAPTER 1 INTRODUCTION TO OPERATING SYSTEMS
Introduction to Operating Systems Concepts
Comparing TensorFlow Deep Learning Performance Using CPUs, GPUs, Local PCs and Cloud Pace University, Research Day, May 5, 2017 John Lawrence, Jonas Malmsten,
NFV Compute Acceleration APIs and Evaluation
Java Programming: From the Ground Up
TensorFlow– A system for large-scale machine learning
Deep Learning Software: TensorFlow
The language focusses on ease of use
Advanced Computer Systems
Analysis of Sparse Convolutional Neural Networks
Visit for more Learning Resources
MET4750 Techniques for Earth System Modeling
CSC391/691 Intro to OpenCV Dr. Rongzhong Li Fall 2016
Benchmarking Deep Learning Inference
Tensorflow Tutorial Homin Yoon.
Topics Introduction Hardware and Software How Computers Store Data
Introduction to the C Language
pycuda Jin Kwon Kim May 25, 2017 Hi my name is jin kwon kim.
Introduction to Visual Basic 2008 Programming
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Spark Presentation.
Deep Learning Libraries
Intro to NLP and Deep Learning
Mini Presentations - part 2
Overview of TensorFlow
Node.Js Server Side Javascript
Prepared by Kimberly Sayre and Jinbo Bi
Torch 02/27/2018 Hyeri Kim Good afternoon, everyone. I’m Hyeri. Today, I’m gonna talk about Torch.
Compiler Construction
Computer Science I CSC 135.
Introduction to the C Language
INF 5860 Machine learning for image classification
Brewing Deep Networks With Caffe
Web Development Using ASP .NET
Chapter 6 System and Application Software
Deep Learning Packages
An open-source software library for Machine Intelligence
Chapter 2: System Structures
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Lesson Objectives Aims Key Words Compiler, interpreter, assembler
Topics Introduction Hardware and Software How Computers Store Data
CSC 578 Neural Networks and Deep Learning
Protech’s Short and Long Term Roadmap
ICT Programming Lesson 1:
Tensorflow Tutorial Presented By :- Ankur Mali
Dr. Sampath Jayarathna Cal Poly Pomona
Chapter 6 System and Application Software
TensorFlow: A System for Large-Scale Machine Learning
Chapter 6 System and Application Software
6- General Purpose GPU Programming
Chapter 6 System and Application Software
Deep Learning Libraries
CSC 578 Neural Networks and Deep Learning
Machine Learning for Cyber
Machine Learning for Cyber
Presentation transcript:

APACHE MXNET By Beni Mulyana

Introduction Apache MXNet is a modern open-source deep learning framework used to train, and deploy deep neural networks. It is scalable, allowing for fast model training, and supports a flexible programming model and multiple languages. Currently, MXNet is supported by Intel, Dato, Baidu,Microsoft, Wolfram Research, and research institutions such as Carnegie Mellon, MIT, the University of Washington, and the Hong Kong University of Science and Technology. Developed by Apache Software Foundation Written in : C++, Python, R, Julia, JavaScript Operating system : Linux, Windows, macOS Website : mxnet.apache.org

MXNET Features Scalable : can achieve almost linear scale with multiple GPU/CPU Flexible : MXNet supports both imperative and symbolic programming, symbolic programming makes it easier for developers that have plan in chart, afterward implement it using symbolic programming to get started with deep learning Multiple Languages : Supports C++ for the optimized backend to get the most of the GPU or CPU available, also support for Python, R, Scala, Julia, Perl, Matlab and Javascript for the simple to use frontend for the developers Portable : Supports an efficient deployment of a trained model to low-end devices for inference, such as mobile devices (using Amalgamation), IoT devices (using AWS Greengrass), Serverless (Using AWS Lambda) or containers. These low-end environments can have only weaker CPU or limited memory (RAM), and should be able to use the models that were trained on a higher-level environment (GPU based cluster, for example).

Installation For installation explained completly in : https://mxnet.apache.org/install/index.html Install CUDA 8.0 following the NVIDIA’s Install cuDNN 7 for CUDA 8.0 Install virtualenv for Ubuntu by this command : sudo apt-get update sudo apt-get install -y python-dev python-virtualenv Create and activate virtualenv environment for MXNet : virtualenv --system-site-packages ~/mxnet source ~/mxnet/bin/activate --> will appears : (mxnet)$ Install MXNet in the active virtualenv environment : pip install --upgrade pip (Installing MXNet with pip requires a latest version of pip) pip install mxnet-cu80==1.0.0 (Install MXNet with GPU support using CUDA 8.0)

How to validate installation Activate the virtualenv environment created for MXNet Start the python terminal Run a short MXNet python program to create a 2X3 matrix of ones a on a GPU, multiply each element in the matrix by 2 followed by adding 1. We expect the output to be a 2X3 matrix with all elements being 3. We use mx.gpu(), to set MXNet context to be GPUs. >>> import mxnet as mx >>> a = mx.nd.ones((2, 3), mx.gpu()) >>> b = a * 2 + 1 >>> b.asnumpy() array([[ 3., 3., 3.], [ 3., 3., 3.]], dtype=float32)

Imperative and Symbolic Programs MXNET can support Imperative and Symbolic Programs. For example Imperative and Symbolic program : import numpy as np a = np.ones(10) b = np.ones(10) * 2 c = b * a d = c + 1 A = Variable('A') B = Variable('B') C = B * A D = C + Constant(1) # compiles the function f = compile(D) d = f(A=np.ones(10), B=np.ones(10)*2) As you can see, in the symbolic version, when C = B * A is executed, no computation occurs. Instead, this operation generates a computation graph (also called a symbolic graph) that represents the computation. The following figure shows a computation graph to compute D.

Imperative and Symbolic Programs Most symbolic-style programs contain, either explicitly or implicitly, a compile step. This converts the computation graph into a function that we can call later. In the above example, numerical computation only occurs in the last line of code. The defining characteristic of symbolic programs is their clear separation between building the computation graph and executing it. For neural networks, we typically define the entire model as a single compute graph.

Advantages of Symbolic Program Symbolic Programs more Memory efficient : For example : from previous imperative program, Assume that each cell in the array occupies 8 bytes of memory. As an imperative program we need to allocate memory at each line. That leaves us allocating 4 arrays of size 10. So we’ll need 4 * 10 * 8 = 320 bytes. On the other hand, if we built a computation graph, and knew in advance that we only needed d, we could reuse the memory originally allocated for intermediate values. For example, by performing computations in-place, we might recycle the bits allocated for b to store c. And we might recycle the bits allocated for c to store d. In the end we could cut our memory requirement in half, requiring just 2 * 10 * 8 = 160 bytes. Symbolic programs can perform operation folding : Returning to our example, the multiplication and addition operations can be folded into one operation, as shown in the following graph. If the computation runs on a GPU processor, one GPU kernel will be executed, instead of two. In fact, this is one way we hand-craft operations in optimized libraries. Operation folding improves computation efficiency.

Symbolic Basic Neural Networks in MXNET Symbol also supports a rich set of neural network layers. For the complete lists of Mxnet-Python API, could see in the link : https://mxnet.incubator.apache.org/api/python/index.html The following example constructs a two layer fully connected neural network and then visualizes the structure of that network given the input data shape : import mxnet as mx net = mx.sym.Variable('data') net = mx.sym.FullyConnected(data=net, name='fc1', num_hidden=128) net = mx.sym.Activation(data=net, name='relu1', act_type="relu") net = mx.sym.FullyConnected(data=net, name='fc2', num_hidden=10) net = mx.sym.SoftmaxOutput(data=net, name='out') mx.viz.plot_network(net, shape={'data':(100,200)})

Symbolic Basic Neural Networks in MXNET It will automatically create symbolic graph : Each symbol takes a (unique) string name. Operators take symbol (or NDArray) as inputs and might also additionally accept other hyperparameters such as the number of hidden neurons (num_hidden) or the activation type (act_type) and produce the output. We can view a symbol simply as a function taking several arguments. And we can retrieve those arguments with the following method call: net.list_arguments() ['data', 'fc1_weight', 'fc1_bias', 'fc2_weight', 'fc2_bias', 'out_label'] These arguments are the parameters and inputs needed by each symbol

THANK YOU!.