Learning • Supervised - learning by example, input data has labels • Unsupervised - input data has no labels • Reinforcement learning - learn by feedback from environment An example of supervised learning, classification: Use model to predict Train a model Collect training data 5
Training - the process of determining the ideal parameters (for example weights or learning rate) comprising a model. You feed input data into a model and go through an iterative process to come up with the model Inference - apply trained model to make predictions on new examples 6
learning Computer Vision • Image classification - is this a cat? • Object detection - self driving car • Generating new images Generating new images using generative adversarial networks (GANs) Is this a cat? 7
Interactive programming in the web browser • Great for visualization • Great for collaboration • Popular tool for studying machine learning / deep learning 9
Jupyter Notebook running on Google’s VM in the cloud • Free GPU • TensorFlow is already installed • Save and share from your Drive • Save directly to GitHub Check out my blogpost on Colab, and TensorFlow team’s blog on Colab 10
is a deep learning framework for both research & production Write TensorFlow code in C++, Python, Java, R, Go, SWIFT, JavaScript Deploy to CPU, GPU, TPU, Mobile, Android Things, Raspberry Pi tf.* tf.layers tf.keras Custom Estimator Premade Estimator ← Low level ← mid level ← high level ← model in a box ← distributed execution, tf serving 12
Nodes - represents mathematical operations • Edges - represent arrays of data To write TensorFlow code: 1. First we define the graph 2. Then run the graph by creating / running the session 13 1 1 2 Add Operator 1 + 1 = 2
or strings Instead, data are stored in an object called tensor • tf.constant - the value of the tensor never changes • tf.placeholder - returns a tensor that gets values from data passed to tf.session.run(), for example, training dataset • tf.variable - a tensor with an initial value that can be modified, example: weights and biases. 15
long need to create a session then call sessions.run() • Easier for debugging • Enable eager Execution - tf.enable_eager_execution() • Great for research, for production use graph execution Learn more about eager execution: • Programmer’s Guide • Get Started with Eager - Colab tutorial classifies Iris flowers 16
Tensorflow.org Deep learning with Python by Francois Chollet TensorFlow on Youtube TensorFlow on Twitter #AskTensorFlow #TensorFlowMeets Collection of interactive ML examples (blogpost | website) TensorFlow Dev Summit Blog.tensorflow.org 17
MNIST data, hello world of deep learning and computer vision 1. Import data 2. Define a model 3. Train the model 4. Use the model to predict Here is the tutorial link. 19
flip, zoom or rotate the images - help prevent overfitting: https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html 21
using TensorFlow From training your own model to calling cloud API: • Train your model from scratch • Transfer learning: ◦ Feature extraction or fine tuning on pre-trained model ◦ TensorFlow hub (https://www.tensorflow.org/hub/) • Use a pre-trained model • Use Google Cloud APIs (cloud.google.com/products/ai/) 22