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.

20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session

6,856 views

Published on

AWS公式オンラインセミナー: https://amzn.to/JPWebinar
過去資料: https://amzn.to/JPArchive

Published in: Technology
  • Isn't it about time you started ●●● https://dwz1.cc/DU3z4dss
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

20190206 AWS Black Belt Online Seminar Amazon SageMaker Basic Session

  1. 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Makoto Shimura, Solutions Architect 2019/02/06 Amazon SageMaker [AWS Black Belt Online Seminar]
  2. 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • • • • ⎼ Amazon Athena ⎼ AWS Glue ⎼ Amazon SageMaker
  3. 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark AWS Black Belt Online Seminar • • ① 吹き出しをクリック ② 質問を入力 ③ Sendをクリック Twitter #awsblackbelt
  4. 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • 2019 02 06 AWS (http://aws.amazon.com) • AWS AWS • • AWS does not offer binding price quotes. AWS pricing is publicly available and is subject to change in accordance with the AWS Customer Agreement available at http://aws.amazon.com/agreement/. Any pricing information included in this document is provided only as an estimate of usage charges for AWS services based on certain information that you have provided. Monthly charges will be based on your actual use of AWS services, and may vary from the estimates provided.
  5. 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • • Amazon SageMaker • Amazon SageMasker • SageMaker SDK • [ | | ] • Amazon SageMaker •
  6. 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  7. 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 推論推論 大量のCPU や GPU 継続的なデプロイ 様々なデバイスで動作 大量の GPU 大規模データの処理 試行錯誤の繰り返し 学習 学習に使うコードを記述 小規模データで動作確認 開発
  8. 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 推論推論 エンジニアがプロダク ション環境に構築 API サーバにデプロイ エッジデバイスで動作 学習開発 データサイエンティストが開発環境で作業 開発と学習を同じ 1 台のインスタンスで実施 Deep Learning であれば GPU インスタンスを使用
  9. 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 推論推論 エンジニアがプロダク ション環境に構築 API サーバにデプロイ エッジデバイスで動作 学習開発 データサイエンティストが開発環境で作業 開発と学習を同じ 1 台のインスタンスで実施 Deep Learning であれば GPU インスタンスを使用 & • • • • • API • •
  10. 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  11. 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker
  12. 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  13. 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 3 OK - - ( ml.t2.medium ) - IAM ( )
  14. 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark IAM c S3 S3 * IAM
  15. 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark InService Jupyter Jupyter Notebook * JupyterLab JupyterLab
  16. 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Jupyter Notebook SageMaker Examples SageMaker Python Sdk chainer_single_machine_cifer10.ipynb Use Create copy
  17. 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Chainer 1 SageMaker Sagemaker Chainer
  18. 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Sagermaker SDK SDK SDK github * Chainer estimator.fit() estimator.deploy() predictor.predict()
  19. 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker
  20. 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker • • • 13
  21. 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker Jupyter Notebook API EC2 API AB API
  22. 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker Jupyter Notebook API EC2 API AB API
  23. 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker AWS CloudOffice Network SageMaker Service
  24. 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker AWS CloudOffice Network 1. 2. SageMaker Service
  25. 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Service Amazon SageMaker AWS CloudOffice Network 1. SDK 4.2. 3. 5.
  26. 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Service Amazon SageMaker AWS CloudOffice Network 1. SDK 2. 3.
  27. 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Service Amazon SageMaker AWS CloudOffice Network 1. SDK 2. 3. 4. S3 S3 5.
  28. 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker SDK
  29. 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Python SDK & Examples • github SDK • SDK github https://github.com/aws/sagemaker-python-sdk https://github.com/awslabs/amazon-sagemaker-examples
  30. 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker SDK Estimator Chainer Estimator fit() Chainer S3 deploy() predict() transformer.transform() S3 S3
  31. 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Chainer main OK SageMaker argparse model_fn() SageMaker
  32. 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SDK - - Deep Learning Tensorflow ( Keras) Chainer PyTorch MXNet ( Keras) scikit-learn Coach Ray -
  33. 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SDK - - Deep Learning Tensorflow ( Keras) Chainer PyTorch MXNet ( Keras) scikit-learn Coach Ray -
  34. 34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • Linear Learner • Factorization Machines • XGBoost • Image Classification • seq2seq • K-means • k-NN • Object2Vec • Semantic Segmentation • PCA • LDA • Neural Topic Model • DeepAR Forecasting • BlazingText (word2vec) • Random Cut Forest • Object Detection • IP Insights https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html
  35. 35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ID ID https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html
  36. 36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Tensorflow • Tensorflow, Chainer, PyTorch, MXNet, scikit-learn SDK • Tensorflow MXNet Keras • Keras AWS blog * • main github • github https://github.com/aws/sagemaker-python-sdk https://github.com/aws/sagemaker-containers * https://aws.amazon.com/jp/blogs/news/amazon-sagemaker-keras/
  37. 37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker ECR docker run $IMAGE_ID train serve ECR ID https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo.html https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html
  38. 38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark [ ]
  39. 39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • t2 p3 • 5GB-16TB • • Redshift, Athena, EMR https://aws.amazon.com/jp/blogs/news/build-amazon-sagemaker-notebooks-backed-by-spark-in-amazon-emr/ https://aws.amazon.com/jp/blogs/news/build-fast-flexible-secure-machine-learning-platform-using-amazon-sagemaker-and-amazon-redshift/
  40. 40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark git • SageMaker git • • JupyterLab GUI
  41. 41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • • → • •
  42. 42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark [ ]
  43. 43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • scikit-learn instance_count 2 • • /opt/ml/input/config/resourceConfig.json SageMaker • SDK estimator.fit(wait=False)
  44. 44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • Estimater hyperparameters • SageMaker • https://github.com/aws/sagemaker-python-sdk#sagemaker-automatic-model-tuning
  45. 45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • Tensorflow SageMaker pull • SageMaker • nvidia-docker • local https://github.com/aws/sagemaker-python-sdk#local-mode
  46. 46. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Search • • Accuracy Loss • Linage https://aws.amazon.com/blogs/machine-learning/amazon-sagemaker-now-comes-with-new-capabilities-for- accelerating-machine-learning-experimentation/
  47. 47. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark [ ]
  48. 48. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark = 2 • 1 • https://docs.aws.amazon.com/sagemaker/latest/dg/endpoint-auto-scaling.html#endpoint-auto-scaling-add-policy https://docs.aws.amazon.com/ja_jp/autoscaling/application/userguide/application-auto-scaling-target-tracking.html
  49. 49. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark A/B • • • • •
  50. 50. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Embedding https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipelines.html Embedding Classification Client Text Numeric vector Category
  51. 51. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Elastic Inference • Elastic Inference CPU EC2 GPU ML • CPU GPU • 75% • • AWS enhanced versions of TensorFlow • Apache MXNet (including ONNX) https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/working-with-ei.html
  52. 52. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Amazon SageMaker
  53. 53. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker API • SageMaker SDK • AWS SDK SageMaker API SageMaker SDK AWS SDK
  54. 54. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker 3 1: SageMaker 2: GPU AWS 3: SageMaker
  55. 55. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Step Functions ML • Step Functions SageMaker AWS Glue Lambda • Glue – SageMaker – – https://docs.aws.amazon.com/step-functions/latest/dg/connectors-sagemaker.html CloudWatch Events AWS Step Functions workflow ETL
  56. 56. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • ML • SageMaker 1 • ML • • 0.14 USD/GB/ • • • 0.016 USD/GB
  57. 57. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Example Notebooks • https://github.com/awslabs/amazon-sagemaker-examples SageMaker SDK • https://github.com/aws/sagemaker-python-sdk • Doc https://readthedocs.org/projects/sagemaker/ SageMaker • https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/whatis.html
  58. 58. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Q&A AWS Japan Blog https://aws.amazon.com/jp/blogs/news/
  59. 59. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
  60. 60. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Appendix
  61. 61. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Ground Truth • Amazon SageMaker Ground Truth • • • Amazon Mecanical Turk 3 •
  62. 62. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark ML Models in AWS Marketplace Amazon SageMaker 200
  63. 63. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark EMR • SageMaker EMR • EMR VPC • EMR Livy
  64. 64. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Airflow Operator • Airflow 1.10.1 SageMaker Operator • Airflow SageMaker https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/workflow/README.rst
  65. 65. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • RLEStimator • Open AI Gym / Intel Coach / Berkeley Ray RLLib Tensorflow / MXNet • TensorForce StableBaselines • • • AWS : AWS RoboMaker, Amazon Sumerian • : MATLAB and Simulink • : OpenAI Gym, Gym Roboschool, EnergyPlus https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/rl https://docs.aws.amazon.com/sagemaker/latest/dg/reinforcement-learning.html
  66. 66. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • CloudWatch Metrics • CreateTraininJob API • validation:cross_entropy https://aws.amazon.com/jp/blogs/machine-learning/easily-monitor-and-visualize-metrics-while-training-models-on-amazon-sagemaker/
  67. 67. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark • CloudWatch Logs • CloudWatch Logs •
  68. 68. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark PIPE • 2 • FILE: • PIPE: S3 API • PIPE • Tensorflow TFRecord • MXNet RecordIO • Chainer PyTorch PIPE
  69. 69. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark SageMaker Neo • Neo SageMaker • • https://aws.amazon.com/jp/blogs/news/amazon-sagemaker-neo-train-your-machine-learning-models-once-run-them-anywhere/ https://docs.aws.amazon.com/sagemaker/latest/dg/neo.html • TensorFlow • Apache MXNet • PyTorch • ONNX • XGBoost • EC2 c4/5, m4/5, p2/3 • Jetson TX1/2 • DeepLens • Raspberry Pi 3 Model
  70. 70. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark : • KMS key ID SSE-KMS • CreateTrainingJob / • CreateEndpointConfig • • • • • Cloudtrail • PCI DSS HIPPA https://aws.amazon.com/about-aws/whats-new/2018/01/aws-kms-based-encryption-is-now-available-in-amazon-sagemaker-training-and-hosting/ https://aws.amazon.com/about-aws/whats-new/2018/01/aws-cloudtrail-integration-is-now-available-in-amazon-sagemaker/ https://aws.amazon.com/about-aws/whats-new/2018/01/amazon-sagemaker-achieves-pci-dss-compliance/ https://aws.amazon.com/about-aws/whats-new/2018/04/access-amazon-vpc-resources-for-training-and-hosting-with-amazon-sageMaker/ https://aws.amazon.com/about-aws/whats-new/2018/05/Amazon-SageMaker-Achieves-HIPAA-Eligibility/ https://aws.amazon.com/jp/about-aws/whats-new/2018/06/amazon-sagemaker-inference-calls-are-supported-on-aws-privatelink/
  71. 71. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark : • SageMaker S3 S3 VPC • S3 • S3 • SageMaker API PrivateLink • SageMaker Notebook Endpoint • SageMaker Service API • SageMaker Runtime API https://aws.amazon.com/blogs/machine-learning/direct-access-to-amazon-sagemaker-notebooks-from-amazon-vpc-by-using-an-aws-privatelink-endpoint/ https://aws.amazon.com/about-aws/whats-new/2018/04/access-amazon-vpc-resources-for-training-and-hosting-with-amazon-sageMaker/ https://aws.amazon.com/jp/about-aws/whats-new/2018/06/amazon-sagemaker-inference-calls-are-supported-on-aws-privatelink/ https://aws.amazon.com/about-aws/whats-new/2018/08/amazon-sagemaker-apis-supported-on-aws-privatelink/

×