Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS Machine Learning Week SF: Amazon SageMaker & TensorFlow

139 views

Published on

AWS Machine Learning Week at the San Francisco Loft: Build Deep Learning Applications with TensorFlow and SageMaker

Deep learning continues to push the state of the art in domains such as computer vision, natural language understanding and recommendation engines. In this workshop, you’ll learn how to get started with the TensorFlow deep learning framework using Amazon SageMaker, a platform to easily build, train and deploy models at scale. You’ll learn how to build a model using TensorFlow by setting up a Jupyter notebook to get started with image and object recognition. You’ll also learn how to quickly train and deploy a model through Amazon SageMaker.

  • Be the first to comment

  • Be the first to like this

AWS Machine Learning Week SF: Amazon SageMaker & TensorFlow

  1. 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft Workshop: Amazon SageMaker and Tensorflow
  2. 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Agenda • About • Concepts & Tools • Setup • Notebooks • Teardown
  3. 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved The AWS Machine Learning Stack AI SERVICES ML PLATFORMS ML FRAMEWORKS VISION Rekognition Video Rekognition SPEECH TranscribePolly LANGUAGE ComprehendTranslate CHATBOTS Lex AWS DeepLensAmazon SageMaker TensorFlow MXNet PyTorch Caffe2 Chainer Horvod Gluon Keras Mechanical Turk
  4. 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved About Everything you need to know about this workshop
  5. 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Workshop Details • Timeframe: – Two hour hands-on workshop • Scope: – Easily building models and operating TensorFlow using Amazon SageMaker • Outcome: – You will have built five neural networks within Amazon SageMaker https://github.com/tensorflow/tensorflow
  6. 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Prerequisites Required • AWS Account • Root account / privileged IAM user – sufficient permission to run Amazon SageMaker, access Amazon S3 Not Required • TensorFlow experience • Amazon SageMaker experience • Machine Learning experience • Python experience
  7. 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Concepts and Tools Everything you need to know for this workshop
  8. 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Artificial Neural Networks (ANN) Artificial neural networks (ANNs) or connectionist systems are computing systems vaguely inspired by the biological neural networks that constitute animal brains. Such systems "learn" (i.e. progressively improve performance on) tasks by considering examples, generally without task-specific programming. For example, in image recognition, they might learn to identify images that contain cats by analyzing example images that have been manually labeled as "cat" or "no cat" and using the results to identify cats in other images. They do this without any a priori knowledge about cats, e.g., that they have fur, tails, whiskers and cat-like faces. Instead, they evolve their own set of relevant characteristics from the learning material that they process. From https://en.wikipedia.org/wiki/Artificial_neural_network
  9. 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Artificial Neural Networks (ANN) Artificial neural networks (ANNs) or connectionist systems are computing systems vaguely inspired by the biological neural networks that constitute animal brains. Such systems "learn" (i.e. progressively improve performance on) tasks by considering examples, generally without task-specific programming. For example, in image recognition, they might learn to identify images that contain cats by analyzing example images that have been manually labeled as "cat" or "no cat" and using the results to identify cats in other images. They do this without any a priori knowledge about cats, e.g., that they have fur, tails, whiskers and cat-like faces. Instead, they evolve their own set of relevant characteristics from the learning material that they process. From https://en.wikipedia.org/wiki/Artificial_neural_network TL;DR: transforms input to output in a complex manner
  10. 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved TensorFlow “TensorFlow is an open source software library for numerical computation using data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture lets you deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device without rewriting code. TensorFlow also includes TensorBoard, a data visualization toolkit.” - From official Tensorflow repo: https://github.com/tensorflow/tensorflow
  11. 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved TensorFlow “TensorFlow is an open source software library for numerical computation using data flow graphs. The graph nodes represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) that flow between them. This flexible architecture lets you deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device without rewriting code. TensorFlow also includes TensorBoard, a data visualization toolkit.” - From official Tensorflow repo: https://github.com/tensorflow/tensorflow TL;DR: a framework for creating artificial neural networks
  12. 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon SageMaker Amazon SageMaker is a fully-managed platform that enables developers and data scientists to quickly and easily build, train, and deploy machine learning models at any scale. Amazon SageMaker removes all the barriers that typically slow down developers who want to use machine learning.
  13. 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved https://jupyter.org/ Amazon SageMaker Notebooks • Programming environments for ad-hoc data analysis • Support for many languages – Python2/3 most common • Persistent artifact – .ipynb format • Can be run: – managed Notebook Instance in Amazon SageMaker – self-hosted (Amazon EC2 instances, laptop, etc)
  14. 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon SageMaker Jobs • Tasks that train your neural networks with data • Created via one line of code – In Python SDK: instantiate TensorFlow object • Executes training job • Under the covers: – AWS Batch – Amazon EC2 instances • Training outputs a model – Amazon S3 output location – model.tar.gz .fi
  15. 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Amazon SageMaker Endpoints • Deploys your model for inference as an API endpoint – Requires previously trained model.tar.gz • Created via one line of code – In Python: sagemaker.deploy() method • Under the covers: – Amazon EC2 instances .fi
  16. 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Setup Start your engines (ie. your Amazon SageMaker Notebook Instances)
  17. 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Creating the Notebook Instance • Login to AWS Console • Region: US East (N. Virginia) • Service: Amazon SageMaker • Select: Notebook Instances • Click: Create Notebook Instance – Name: sf-loft-2018 – Instance type: ml.t2.medium – Instance role: <select existing role> or <Create New Role> – VPC: none • Wait a few minutes, then Open the new notebook instance
  18. 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved From Notebook Instance • Launch a Terminal session • In the terminal, run the following (can copy from https://amzn.to/2GelxDj) $ git clone https://github.com/awslabs/amazon-sagemaker-examples/ $ mv ./amazon-sagemaker-examples/sagemaker-python-sdk/tensorflow* ./SageMaker
  19. 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Notebooks The workshop exercises via prepared Jupyter Notebooks
  20. 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Sample TensorFlow Notebooks 1. tensorflow_iris_dnn_classifier_using_estimators 2. tensorflow_abalone_age_predictor_using_keras 3. tensorflow_abalone_age_predictor_using_layers 4. tensorflow_distributed_mnist 5. tensorflow_resnet_cifar10_with_tensorboard
  21. 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Example 1: Iris Dataset
  22. 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Example 2 & 3: Abalone Dataset Feature Description Length Length of abalone (in longest direction; in mm) Diameter Diameter of abalone (measurement perpendicular to length; in mm) Height Height of abalone (with its meat inside shell; in mm) Whole Weight Weight of entire abalone (in grams) Shucked Weight Weight of abalone meat only (in grams) Viscera Weight Gut weight of abalone (in grams), after bleeding Shell Weight Weight of dried abalone shell (in grams) https://en.wikipedia.org/wiki/Abalone
  23. 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Example 4: MNIST dataset • Dataset commonly used for machine learning of character recognition • “Hello World” of NN frameworks https://en.wikipedia.org/wiki/MNIST_database
  24. 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Example 5: CIFAR-10 dataset • Dataset commonly used for demonstrating machine learning in image classification • 60,000 32x32 color images in 10 different classes • Classes represent airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks https://en.wikipedia.org/wiki/CIFAR-10
  25. 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Teardown Clean up your workshop resources
  26. 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Delete Me • Delete all Amazon SageMaker resources, such as: – Notebook Instances – Models – Endpoint Configurations – Endpoints • Delete all Amazon S3 buckets and files
  27. 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved Pop-up Loft aws.amazon.com/activate Everything and Anything Startups Need to Get Started on AWS

×