Download presentation
Presentation is loading. Please wait.
Published byAmy Waters Modified over 6 years ago
1
TENSORFLOW Team 2: Andrey, Daniel, John, Jonas, Ken
101
2
AGENDA - Purpose - Andrey / Danny - Concepts - Andrey / Danny
- What is a Tensor? - Danny - What is Tensorflow - Danny - Why Tensorflow? - Benefits and Advantages of Tensorflow over other frameworks - Ken - Tensorflow Criticism - John - How does it work? / DEMO - Jonas - Questions
3
Purpose of our research
Explore various emerging deep learning frameworks Compare various properties of these frameworks: performance, ability to recognize etc.
4
AI, ML, Deep Learning?
5
AI, Deep Learning ultimately needs Machine Learning
6
What is Machine Learning?
“Machine learning is the subfield of computer science that gives computers the ability to learn without being explicitly programmed" (Arthur Samuel, 1959). Machine learning is closely related to (and often overlaps with) computational statistics, which also focuses in prediction-making through the use of computers.
7
What is Deep Learning? Deep learning is type of Machine Learning that enables computational models that are composed of multiple processing layers to learn representations of data with multiple levels of abstraction. Applications where Deep Learning was successful: state-of-the-art in speech recognition visual object recognition object detection many other domains such as drug discovery and genomics INTRODUCTION TO MACHINE LEARNING AN EARLY DRAFT OF A PROPOSED TEXTBOOK Nils J. Nilsson
8
What is a Tensor? Formally, tensors are multilinear maps from vector spaces to the real numbers ( V vector space, and V* dual space) A scalar is a physical quantity that can be completely described by a real number. The expression of its component is independent of the choice of the coordinate system. Example: Temperature; Mass; Density; Potential…. A vector is a physical quantity that has both direction and length. The expression of its components is dependent of the choice of the coordinate system. Example: Displacement; Velocity; Force; Heat flow; ….
9
WHAT IS TENSORFLOW? TensorFlow is a powerful library for doing large-scale numerical computation. One of the tasks at which it excels is implementing and training deep neural networks. TensorFlow provides primitives for defining functions on tensors and automatically computing their derivatives. Nodes in a graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. Think of TensorFlow as a flexible data flow based programming model for machine learning.
10
BACKGROUND TensorFlow was originally developed by researchers and engineers working on the Google Brain Team within Google's Machine Intelligence research organization for the purposes of conducting machine learning and deep neural networks research, but the system is general enough to be applicable in a wide variety of other domains as well.
11
WHY TENSORFLOW? •Any individual, company, or organization could build their own Artificial Intelligence (AI) applications using the same software that Google does to fuel everything from photo recognition to automated replies. •However, while Google stretches its platform across thousands of computer servers, the version it released to the public could run only on a single machine. Thus making TensorFlow considerably less capable for others at one point.
12
WHY TENSORFLOW? (Con’t)
• At this time, the most notable new feature is the ability for TensorFlow to run it on multiple machines at the same time. However, many researchers and startups could benefit from being able to run TensorFlow on multiple machines. •TensorFlow is based on a branch of AI called “Deep Learning”, which draws inspiration from the way that human brain cells communicate with each other. •“Deep Learning” has become central to the machine learning efforts of other tech giants such as Facebook, Microsoft, and Yahoo, all of which are busy releasing their own AI projects into the wild.
13
TOP 5 ADVANTAGES of TENSORFLOW
1.Flexibility: You need to express your computation as a data flow graph to use TensorFlow. It is a highly flexible system which provides multiple models or multiple versions of the same model, and it can be served simultaneously. The architecture of TensorFlow is highly modular, which means you can use some parts individually or can use all the parts together. Such flexibility facilitates non-automatic migration to new models/versions, and A/B types of testing with experimental models. Lastly, allows you to deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API. 2.Portability: TensorFlow has made it possible to play around an idea on your laptop without having any other hardware support. It runs on GPUs, CPUs, desktops, servers, and mobile computing platforms. You can a lso deploy a trained model on your mobile, as a part of your product, and that’s how it serves as a true portability feature.
14
TOP 5 ADVANTAGES of TENSORFLOW (Con’t)
3.Research and Production: It can be used to train and serve models in live mode to real customers. Stated plainly, rewriting codes is not required and the industrial researchers can apply their ideas to products a lot faster. Also, academic researchers can share codes directly with greater reproducibility. In this manner, it helps to carry out research and production processes faster. 4.Auto Differentiation: It has automatic differentiation capabilities which benefits gradient based machine learning algorithms. You can define the computational architecture of your predictive model, combine it with your objective function and add data to it, and TensorFlow manages derivatives computing processes automatically. You can compute the derivatives of some values with respect to some other values results in graph extension and you can see exactly what’s happening.
15
TOP 5 ADVANTAGES of TENSORFLOW (Con’t)
5.Performance: TensorFlow allows you to make the most of your available hardware with its advanced support for threads, asynchronous computation, and queues.
16
OTHER FRAMEWORKS Other frameworks that compete, or are compatible to TensorFlow are ‘some’ of the following:: fchollet/keras: Kerras Lasagne Blocks Pylearn2 Theano Caffe
17
Criticism Doesn’t solve a specific use case?
Code isn’t any easier to read than other competing solutions Scalability Performance [1] Only partially open source - hardware, parts of the AI software closed [2] Lack of Symbolic loops ("scan" in Theano) [3] [1] M. Mayo. (2016, ). TensorFlow Disappoints – Google Deep Learning falls shallow. Available: deep-learning-disappoints.html/2 [2] (2016, ). TensorFlow. Available: [3] A. Hibble. (2016, ). What is unique about Tensorflow from the other existing Deep Learning Libraries? Available: unique-about-Tensorflow-from-the-other-existing-Deep-Learning-Libraries
18
Criticism May accelerate AI systems that are hard to understand and/or will have difficulties in communication Attention may be focused on experimenting with mathematical trick rather than on understanding human thought processes [2] [4] E. T. Mueller. (2015, ). Google’s TensorFlow Alone Will Not Revolutionize AI. Available: revolutionize-ai/
19
HOW DOES IT WORK?
20
DEMO Fastest way to get started with Tensoflow: Installation on Windows 10 Pro using Docker. Tensorflow tutorial using the MNIST dataset: Tensorboard to display graphical layout of machine learning network, and graph progress during learning. Deploy trained model on any device (not part of this demo).
21
Installation Install Docker for Windows from here (Requires Windows 10 Pro): Open a command prompt and run: docker run -it -p 8888:8888 -p 6006:6006 gcr.io/tensorflow/tensorflow DEMO Forward ports 8888 for Jupyter environment, and 6006 for Tensorboard (next slides). Tensorflow running inside a docker container on Windows will not be able to use GPU to accelerate calculations. While Google have announced that a Windows version with GPU support is coming, currently the only way to use GPU acceleration is to run Tensorflow natively on Linux, or inside an NVidia Docker container on native Linux. However, GPU support is not required for simple demo using MNIST.
22
DEMO Jupyter Environment Open browser and navigate to jupyter at:
Select New | Notebooks: Python 2, as indicated below, to open a python environment. DEMO
23
In the python 2 notebook, paste the following 2 lines, and press the run button:
from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) This will download the MNIST dataset into the docker instance. An asterisk will appear on the left while program is running. DEMO
24
Verify that the MNIST dataset has been downloaded in the main Jupyter screen. These steps must be repeated each time the docker instance is restarted, as nothing inside the docker is persistent. There are ways to map external, persistent, drives inside docker, but this is out of scope for this demo. DEMO
25
Tensorboard Tensorboard is used to visualize what is going on inside a deep learning network. Open a terminal in jupyter and type: tensorboard --logdir data DEMO
26
DEMO To get something to show in Tensorboard we must create a machine learning network and run it. I will use this code (modified version from the MNIST tutorial): # from tutorial from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) import tensorflow as tf x = tf.placeholder(tf.float32, [None, 784], "x") W = tf.Variable(tf.zeros([784, 10])) b = tf.Variable(tf.zeros([10])) y = tf.nn.softmax(tf.matmul(x, W) + b) y_ = tf.placeholder(tf.float32, [None, 10], "y_") cross_entropy = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1])) train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy) init = tf.initialize_all_variables() sess = tf.Session() sess.run(init) # Tensor board graph (was not in tutorial) writer = tf.train.SummaryWriter("log", sess.graph) correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_,1)) accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) training_summary = tf.scalar_summary("training_accuracy", accuracy) validation_summary = tf.scalar_summary("validation_accuracy", accuracy) for i in range(1000): batch_xs, batch_ys = mnist.train.next_batch(100) sess.run(train_step, feed_dict={x: batch_xs, y_: batch_ys}) if i % 20 == 0: # Tensor board graph (was not in tutorial) train_acc, train_summ = sess.run( [accuracy, training_summary], feed_dict={x : mnist.train.images, y_ : mnist.train.labels}) writer.add_summary(train_summ, i) valid_acc, valid_summ = sess.run( [accuracy, validation_summary], feed_dict={x : mnist.validation.images, y_ : mnist.validation.labels}) writer.add_summary(valid_summ, i)
27
Navigate to tensorboard at:
DEMO
28
Navigate to tensorboard at:
DEMO
29
Things you can do with Tensorflow
30
QUESTIONS?
31
Competitors Torch Caffe Theano (Keras, Lasagne) Mxnet
32
References https://arxiv.org/abs/1603.04467
TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.