Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TensorFlow - Learning Machines

Vikram
October 14, 2017

TensorFlow - Learning Machines

Presented at #devfest #gdgcv GDG Cloud Vancouver and GDG Chicago with supporting code repo from: https://github.com/VikramTiwari/tensorflow-retrain-sample

Vikram

October 14, 2017
Tweet

More Decks by Vikram

Other Decks in Technology

Transcript

  1. Graph You define the graph in high-level language (Python) Graph

    is compiled and optimized Graph is executed (in part, or fully) on devices Nodes represent computations Data (tensors) flows between them
  2. With special operations for deep learning Similar to NumPy Numpy

    TensorFlow add mul matmul … sum … add multiply matmul … reduce_sum … sigmoid relu …
  3. Inference import tensorflow as tf x = tf.placeholder(shape=[None], dtype=tf.float32) m

    = tf.Variable(tf.random_normal([1])) b = tf.Variable(tf.random_normal([1])) y = m * x + b with tf.Session() as sess: sess.run(tf.initialize_all_variables()) print(sess.run(y, feed_dict={x: x_in})) Build the graph Prepare execution env Initialize variables Run the computation
  4. Putting it together loss = tf.reduce_mean(tf.square(y - y_train)) optimizer =

    tf.train.GradientDescentOptimizer(0.5) train = optimizer.minimize(loss) with tf.Session() as sess: sess.run(tf.global_variable_initalizer()) for i in range(1000): sess.run(train, feed_dict={x: x_data[i], y_label: y_data[i]}) Define a loss Create an optimizer Op to minimize the loss Iteratively run the training op Initialize variables
  5. TensorFlow Distributed Execution Engine CPU GPU Android iOS ... C++

    Frontend Python Frontend ... Layers Estimator Models in a box Train and evaluate models Build models Keras Model Canned Estimators
  6. Who uses it? #google Search Gmail Translate Maps Android Photos

    Speech YouTube Play … many others ... Production use in many areas: Internal TensorFlow launch Research use for: 100s of projects and papers
  7. Next Steps Tutorials and code tensorflow.org Intro to Deep Learning

    with TensorFlow Udacity class goo.gl/iHssII Stanford’s CS231n cs231n.github.io Udacity’s Machine Learning Nanodegree goo.gl/ODpXj4 Totally new to ML? Recipes goo.gl/KewA03