Tensorflow Tutorial Homin Yoon.

Slides:



Advertisements
Similar presentations
Theano Md. Iftekhar Tanveer Rafayet Ali Md. Iftekhar Tanveer Rafayet Ali.
Advertisements

Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Shekoofeh Azizi Spring  CUDA is a parallel computing platform and programming model invented by NVIDIA  With CUDA, you can send C, C++ and Fortran.
2012/06/22 Contents  GPU (Graphic Processing Unit)  CUDA Programming  Target: Clustering with Kmeans  How to use.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
CISC105 General Computer Science Class 1 – 6/5/2006.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Mar. 9, 2010.
M Machine Learning F# and Accord.net. Alena Dzenisenka Software architect at Luxoft Poland Member of F# Software Foundation Board of Trustees Researcher.
The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction.
Exercise #1: Exploring Open- Source Operating Systems with Virtual Machines J. H. Wang Sep. 25, 2015.
CUDA Basics. Overview What is CUDA? Data Parallelism Host-Device model Thread execution Matrix-multiplication.
Department of Computer Science and Software Engineering
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
GPU Programming Contest. Contents Target: Clustering with Kmeans How to use toolkit1.0 Towards the fastest program.
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,
TensorFlow The Deep Learning Library You Should Be Using.
Machine Learning Supervised Learning Classification and Regression
Big data classification using neural network
TensorFlow CS 5665 F16 practicum Karun Joseph, A Reference:
TensorFlow– A system for large-scale machine learning
Deep Learning Software: TensorFlow
Zheng ZHANG 1-st year PhD candidate Group ILES, LIMSI
Component 1.6.
Big Data A Quick Review on Analytical Tools
CS427 Multicore Architecture and Parallel Computing
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Parallel processing is not easy
pycuda Jin Kwon Kim May 25, 2017 Hi my name is jin kwon kim.
Computing Gradient Hung-yi Lee 李宏毅
Deep Learning Libraries
Intro to NLP and Deep Learning
CS 224S: TensorFlow Tutorial
Overview of TensorFlow
A VERY Brief Introduction to Convolutional Neural Network using TensorFlow 李 弘
Teaching Computing to GCSE
Meng Cao, Xiangqing Sun, Ziyue Chen May 28th, 2014
Teaching Computing to GCSE
TensorFlow and Clipper (Lecture 24, cs262a)
Introduction to CuDNN (CUDA Deep Neural Nets)
Neural Networks and Backpropagation
Torch 02/27/2018 Hyeri Kim Good afternoon, everyone. I’m Hyeri. Today, I’m gonna talk about Torch.
Tensorflow in Deep Learning
CSE Social Media & Text Analytics
INF 5860 Machine learning for image classification
Deep Learning Packages
Introduction to Tensorflow
An open-source software library for Machine Intelligence
Use of Mathematics using Technology (Maltlab)
MXNet Internals Cyrus M. Vahid, Principal Solutions Architect,
Introduction to Deep Learning with Keras
GENERAL VIEW OF KRATOS MULTIPHYSICS
MNIST Dataset Training with Tensorflow
CSC 578 Neural Networks and Deep Learning
APACHE MXNET By Beni Mulyana.
AI abc Learn AI in one hour Do AI in one day (a life
Neural Networks Geoff Hulten.
Vinit Shah, Joseph Picone and Iyad Obeid
雲端計算.
Introduction to CUDA.
Tensorflow Tutorial Presented By :- Ankur Mali
Tensorflow Lecture 박 영 택 컴퓨터학부.
TensorFlow: A System for Large-Scale Machine Learning
Deep Learning Libraries
Time Complexity and Parallel Speedup to Compute the Gamma Summarization Matrix Carlos Ordonez, Yiqun Zhang University of Houston, USA 1.
In Today’s Class.. General Kernel Responsibilities Kernel Organization
CSC 578 Neural Networks and Deep Learning
Deep Learning with TensorFlow
Overall Introduction for the Lecture
Machine Learning for Cyber
Presentation transcript:

Tensorflow Tutorial Homin Yoon

What is Tensorflow? 01 Is a Open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) Open source software library for numerical computation It uses data flow graphs.(Node : operation, Edge : tensor)

What is Tensorflow? Data Flow Graph 01 Data Flow Graph Nodes in the graph represent mathematical operations Edges describe the i/o relationships between nodes Data edges carry dynamically-sized multidimensional data arrays, or tensors Is a Open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors)

What is Tensorflow? Machine Learning requires complex computations. 01 Is a Open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) Machine Learning requires complex computations. They are hard to display.(Tensor board)

Installation Tensorflow suits with Linux 02 Tensorflow suits with Linux Virtual machine is not helpful because it is impossible to access process unit when it has compuation Therefore, I have installed ubuntu by using dual boot

Installation We have to install python 2.7version 02 We have to install python 2.7version Because newest version doesn’t support all library To import tensorflow, we should install anaconda Otherwise, there would be import error

Installation If you want to use GPU for computation for ML 02 If you want to use GPU for computation for ML You have to install CUDA tool kit. CUDA is Compute Unified Device Architecture Just for CPU computation, cuda toolkit isn’t needed

Installation 02 CUDNN can boost GPU so that computation speed is increased even higher You should give a permission of CUDNN library To every user in Ubuntu

Installation Finally, Only tensorflow package is left 02 Finally, Only tensorflow package is left Download tensorflow source file and compile with Bazel Compiler made by google

Installation Platform: Ubuntu16.04(Linux) 02 Platform: Ubuntu16.04(Linux) Language & tool: Python2.7 & Anaconda For GPU: CUDA Toolkit & CUDNN Complier for tensorflow package: Bazel Now, we can START TENSORFLOW

Simple code(multiply) 03 import tensorflow as tf a = tf.placeholder("float") b = tf.placeholder("float") y = tf.mul(a, b) sess = tf.Session() print sess.run(y, feed_dict={a: 3, b: 3})

Simple code(multiply) 03 Operation Description tf.add sum tf.sub substraction tf.mul multiplication tf.div division tf.mod module tf.abs return the absolute value tf.neg return negative value

Simple code(multiply) 03 Operations & Kernels An operation has a name and represents an abstract computation (e.g., “matrix multiply”, or “add”) A kernel is a particular implementation of operation that can be run on a particular device (e.g., CPU or GPU).

Simple code(multiply) 03 Operations groups Operations Maths Add, Sub, Mul, … Array Concat, Slice, Split, Constant, … Matrix MatMul, MatrixInverse, MatrixDeterminant Neuronal Network SoftMax, Sigmoid, ReLU, Convolution2D, MaxPool Flow control Merge, Switch, Enter, Leave, NextIteration

Linear Regression 04

Linear Regression 04 linear regression is an approach for modeling the relationship between a scalar dependent variable y and one or more variables denoted X.

Linear Regression y = W * x + b y = 0.1 * x + 0.3 Cost function: 04 y = W * x + b y = 0.1 * x + 0.3 Cost function: Mean square error It uses gradient descent

Linear Regression 04

Clustering Tensor Shape, Rank and Dimension 05 Tensor Shape, Rank and Dimension Shape Rank Dimension-Number [] 0 0-D [D0] 1 1-D [D0, D1] 2 2-D [D0, D1, D2] 3 3-D … … … [D0, D1, ... Dn] n n-D

Clustering Data Storage in TensorFlow 05 Data Storage in TensorFlow Data files ://github.com/jorditorresBCN/ LibroTensorFlow/blob/master/input_data.py Memory: • Constants tf.constant(…) • Variables tf.Variable(…) Python code : Placeholders • feed_dict parameter

Clustering import tensorflow as tf a = tf.placeholder("float") 05 import tensorflow as tf a = tf.placeholder("float") b = tf.placeholder("float") y = tf.mul(a, b) sess = tf.Session() print sess.run(y, feed_dict={a: 3, b: 3})

Clustering K-mean Algorithm 05 K-mean Algorithm As it is a heuristic algorithm, there is no guarantee that it will converge to the global optimum, and the result may depend on the initial clusters. As the algorithm is usually very fast, it is common to run it multiple times with different starting conditions.

Clustering 05 vectors = tf.constant(conjunto_puntos) k = 4 centroides = tf.Variable(tf.slice(tf.random_shuffle(vectors),[0,0],[k,-1])) expanded_vectors = tf.expand_dims(vectors, 0) expanded_centroides = tf.expand_dims(centroides, 1) assignments = tf.argmin(tf.reduce_sum(tf.square(tf.sub(expanded_vectors, expanded_centroides)), 2), 0) means = tf.concat(0, [tf.reduce_mean(tf.gather(vectors, tf.reshape(tf.where( tf.equal(assignments, c)),[1,-1])), reduction_indices=[1]) for c in xrange(k)]) update_centroides = tf.assign(centroides, means) init_op = tf.initialize_all_variables() sess = tf.Session() sess.run(init_op) for step in xrange(100): _, centroid_values, assignment_values = sess.run([update_centroides centroides, assignments])

Clustering K-mean Algorithm 05 K-mean Algorithm Initial step (step 0): determines an initial set of K centroids. Allocation step (step 1): assigns each observation to the nearest group. Update step (step 2): calculates the new centroids for each new group

Clustering K-mean Algorithm 05 K-mean Algorithm Initial step (step 0): determines an initial set of K centroids. Allocation step (step 1): assigns each observation to the nearest group. Update step (step 2): calculates the new centroids for each new group

Clustering K-mean Algorithm There are two tensors 05 K-mean Algorithm There are two tensors Vectors(2000 number of distributed point) Centroid(4 centroid)

Clustering K-mean Algorithm print centroid_values 05 K-mean Algorithm print centroid_values [[ 2.99835277e+00 9.89548564e-01] [ -8.30736756e-01 4.07433510e-01] [ 7.49640584e-01 4.99431938e-01] [ 1.83571398e-03 -9.78474259e-01]]

Thank you.