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

Introduction to TensorFlow

phanhoang17
December 08, 2017

Introduction to TensorFlow

#tensorflow #introduction

phanhoang17

December 08, 2017
Tweet

More Decks by phanhoang17

Other Decks in Programming

Transcript

  1. - Opensource deep learning library - Developed by Google Brain

    Team - Released under Apache 2.0 License – 11/9/2015 - Library for numerical computation using data flow graphs (static computational graphs) Overview
  2. - C++, Java, Python, Golang API, .. ==> C#, Julia,

    Ruby, Rust, Scala, .. - CPUs or GPUs – Desktop, Server, Mobile Device with a single API - Flexibility: Linux, iOS, Windows, RasPi, Android, .. - Visualization: TensorBoard - Checkpoint - Large Community Why Tensorflow ?
  3. - Google - Snapchat - Uber - eBay - ...

    Companies using Tensorflow
  4. - Tensors: structure of data - Variable: Define the structure

    of neural net model - Graphs: graphic representation of the computational process Main architecture
  5. - An n-dimensional array 0-d tensor: scalar (number) 1-d tensor:

    vector 2-d tensor: matrix 3-d tensor: cube 4-d tensor: …. so on Tensor?
  6. - Computations are represented as graphs” + Nodes are the

    operations (ops) + Edges are the Tensors (nd-arrays) - Consists of 2 phases: + Define phase: define node, operations + Execution phase: run session Data Flow Graph
  7. >> import tensorflow as tf >> result = tf.add(3, 5)

    # x = 3, y = 5 >> print(result) # 8 ?? # Not 8 # output: Tensor("Add:0", shape=(), dtype=int64) Data Flow Graph
  8. >> import tensorflow as tf >> result = tf.add(3, 5)

    >> sess = tf.Session() >> sess.run(a) # = 8 # output: 8 >> sess.close() Session
  9. >> import tensorflow as tf # constant >> tf.constant(2) #

    variable >> tf.Variable([2, 3], name=”vector”) # placeholder >> tf.placeholder(tf.float32, shape=[3]) Variable
  10. - .meta: save graph structure: variables, operations, collections, .. -

    .data: save values of each variable in the graph: weights, biases, gradients, .. - .index: identify the checkpoint Checkpoint
  11. - TensorFlow Mobile + Fuller set of supported functionality +

    Production cases - TensorFlow Lite + Beta Verion + TensorFlow Mobile version 2 + Small binary size, fewer dependencies, better performance + Limited set of operators Mobile and Embedded Devices
  12. - Keras - Pytorch - Theano - CNTK, Caffe, Torch

    - ... Compare to other frameworks - Deployment - Document, Community - Learning Curve - Debugging - Visualation - Serialization