© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Machine Learning
Services Update
Makoto Shimura
Solution Architect
AWS re:In ven t 2018
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Machine Learning Services Stack
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
今回のアップデートの概要
1. 万人が対象
API サービス - 誰でも機械学習技術を活用できるように
2. [機械学習] 技術者が対象
ML パイプライン - 機械学習のあらゆるプロセスを便利に
3. 機械学習技術者が対象
強化学習 – 機械学習の新たな領域
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API サービス
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Machine Learning Services Stack
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Personalize – easy-to-use なパーソナライズ
• Amazon Personalize は機械学習のエキスパートでない人向けの,レコメンデー
ションやパーソナライゼーションが簡単に行えるサービス
• Amazon が培ったレコメンデーションのナレッジを活用して,データを入れたら自
動でレコメンド・パーソナライズの結果を取得可能
• 既存サービスに簡単にレコメンド機能を追加できるように
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Personalize の利用イメージ
• 以下のようなユースケースに適用可能
• ユーザーの行動ログデータをベースとしたレコメンデーションを実行
• ユーザーごとに検索結果をパーソナライズして,表示順序を変更
• ノーティフィケーションをパーソナライズした形で実行
• バッチデータとストリームデータの両方に対応
• バッチデータは S3 から「ユーザー x 商品」行列形式のデータを取り込む
• ストリームデータは AWS Amplify か AWS SDK 経由でデータを送信
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格
• データ量,学習数,推論数に応じて課金
• 提供リージョン
• バージニア北部
• オレゴン
• ステータス
• 以下のページからプレビュー申請可能
https://pages.awscloud.com/AmazonPersonalizePreview.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Forecast – easy-to-use な時系列予測サービス
• Amazon Forecast は機械学習のエキスパートでない人向けの,時系列データの予測
を簡単に行えるサービス
• Amazon が培った時系列予測のナレッジを活用して,データを入れたら自動で時系
列予測の結果を表示
• ウェブトラフィック,売上データ,商品需要,小売における製品値引きやプロモー
ションの効果などを予測する際に役立つ
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格
• 作成した予測数,保存データ量,学習にかかった時間の 3 要素に応じて課金
• 提供リージョン
• バージニア北部
• オレゴン
• ステータス
• 以下のページからプレビュー申請可能
https://pages.awscloud.com/AmazonForecast-Preview.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Comprehend Medical – メディカルデータ対応
• 文章から様々な情報を抽出する,自然言語理解サービス Amazon
Comprehend の拡張サービスで,メディカルデータ向けのチューニング
を行なったもの
• 症状,治療法,薬等の医療用語,略語に対応できるように追加学習済み
• 医療上の文脈やエンティティの関係性を認識
• Protected health Information (PHI) を抜き出す API も用意.ただし
100 % の精度で検出できるわけではないので,その点に注意して使用す
る必要あり
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Comprehend Medical の利用イメージ
• 症状や治療法のようなエンティティを認識
• 文章構造をみて,単語間の関係性も認識することが可能
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格
• $0.01/unit : Medical Named Entity and Relationship Extraction API
• $0.0014/unit : Medical PHI Data Extraction and Identification API
• 1 unit は 100 文字
• 対応言語
• 英語
• 提供リージョン
• バージニア北部
• オレゴン
• オハイオ
• アイルランド
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Textract – 文章構造も認識可能な OCR
概要
• Amazon Textract は高機能な OCR を提供
• 見出し,ヘッダー,フォーム,テーブル等の構造情報
も認識
• 既存の OCR にあるような文書章フォーマットのテン
プレートをメンテナンスする必要はない
価格
• $1.50 / 1000 pages
ステータス
• 以下のページからプレビュー申請可能
https://pages.awscloud.com/textract-preview.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Translate Custom Terminology – カスタム語彙
• Amazon Translate は高機能な多言語
間翻訳サービス
• ただ固有名詞等,決まった特定の形
で処理をしたいものに関しては,必
ずしもうまく対応できなかった
• カスタム語彙を追加することで,こ
の問題に対応できるように
• ただし多用しすぎると翻訳の質を逆に下げてし
まう
• 商品名,固有名詞のような常に一定の規則で変
換されるもの留めることを推奨
• 言語ごとのカスタム語彙利用推奨,
非推奨は右図の通り
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ML Models in AWS Marketplace –
機械学習モデルのマーケットプレイスを新たに提供開始
• さまざまな会社が提供する機械
学習モデルを,マーケットプレ
イス経由でサブスクライブし,
Amazon SageMaker の学習
ジョブおよび,推論エンドポイ
ントやバッチ推論ジョブで利用
可能に
• 200 以上のアルゴリズムがすで
に公開済み
• 自社アルゴリズムの販売も当然
可能
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SageMaker でのマーケットプレイスモデルの利用
学習ジョブ実行時 モデル作成時
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Machine Learning Services Stack
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ML パイプライン
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
機械学習の分類
ラベルや値を学習
正解あり
ラベルや値を学習
正解なし
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
一般的な機械学習のプロセス
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
データ
準備
実際の機械学習のプロセス
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
機械学習の分類
ラベルや値を学習
正解あり
ラベルや値を学習
正解なし
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker Ground Truth –
効率的アノテーション作業の支援サービス
• Amazon SageMaker Ground Truth は,機械学習の正解データ作成(アノ
テーションと呼ばれる)作業をサポートするマネージドサービス
• 画像や文章に正解ラベルを付与するのは,非常に手間のかかるプロセス
だが,精度の高い正解データ作成は,機械学習活用には必須
• 例えば以下のようなアノテーションを実行可能
• 画像分類(ネコ画像とイヌ画像を分類)
• 物体検出(画像内の複数の物体を,物体の範囲を四角形で囲む形で検出)
• セマンティックセグメンテーション(ピクセルレベルで画像内の領域を分割)
• テキスト分類(ポジティブな文章とネガティブな文章を分類)
• 自分で定義したさまざまなタスク
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Ground Truth によるアノテーション
• ピクセル単位,バウンディングボックス等さまざまなタスクに対応
• アクティブラーニングによる効率的なアノテーション
• ツールを提供するだけでなく,以下のアノーテターを選択可能
• 自社リソース
• 3rd パーティ
• Amazon Mechanical Turk
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
アノテーション作業と結果のチェック
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格
• Amazon Mehcanical Turk および 3rd パーティベンダーのアノテーターを使用するときには,
その利用料が別途かかる
• 提供リージョン
• バージニア北部
• オレゴン
• オハイオ
• アイルランド
• 東京
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
モデル
変換
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker Neo –
各種フレームワーク対応のモデル変換
• Amazon SageMaker Neo は Tensorflow や PyTorch などの Deep Learning フレームワークで学習
したモデルを, EC2 インスタンスや Greengrass デバイス上で高速に動作するように変換する
サービス
• モデルの速度は最大 2 倍に(もちろん予測精度を一切下げることなく)
• 従来のフレームワーク上で 500MB-1GB あるようなモデルが,Amazon SageMaker Neo Runtime
上で 1MB 程度のサイズに
• Apache Software License で OSS として提供
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Neo の対応フレームワークとプラットフォーム
• 対応フレームワーク
• Tensorflow
• Apache MXNet
• PyTorch
• ONYX
• XGBoost
• 対応プラットフォーム
• EC2 インスタンス(ml.c5, ml.c4, ml.m5, ml.m4, ml.p3, ml.p2)
• デバイス
• ARM Cortex-A, Intel Atom, Nvidia Jetson)
• Cadence, Qualcomm, Xilinx にも対応予定
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格
• 無料
• 提供リージョン
• バージニア北部
• オレゴン
• アイルランド
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
推論
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Elastic Inference –GPU による推論を安価に
• Amazon Elastic Inference は GPU リソースを
推論演算ごとに細切れで利用可能とすること
で,推論にかかる費用を削減しながら高速な
推論を行えるサービス
• 現在の GPU は,主に学習プロセスに最適化
されており,これを推論で用いる場合,コス
ト的な無駄が生じやすかった
• 推論に適した CPU / メモリの EC2 インスタン
スを選んだ上で,GPU のスループットを得る
ための EIA (Elastic Inference Accelerator) を以
下の 3 つから選択
• eia1.medium: 8TFLOPS の混合精度演算
• eia1.large: 16TFLOPS の混合精度演算
• eia1.xlarge: 32TFLOPS の混合精度演算
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CPU インスタンスの計算を GPU でアクセラレート
• ワークロードに応じた最適なリソース配分
• 画像処理:more GPU, CPU, and Memory
• 音声認識:less GPU, more CPU and Memory
• たとえば画像分類の推論処理をする場合,コストを下げながら十分なパ
フォーマンスを得ることが可能
インスタンス EIA
推論速度
(msec)
価格 ($/hour)
c5.large なし 230 msec $0.085
c5.large eia1.medium 46 msec $0.22
p2.xlarge なし 42 msec $0.90
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格と提供リージョン
• 価格(東京リージョン)
• eia1.medium: $0.308/h
• eia1.large: $0.630/h
• eia1.xlarge: $1.246/h
• 提供リージョン
• バージニア北部
• オハイオ
• オレゴン
• アイルランド
• ソウル
• 東京
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Inferentia – 機械学習の推論チップ
• AWS Inferentia は,低コストで高性能を実現するように設計された機械学習の推論
チップ
• TensorFlow,Apache MXNet,PyTorch ONNX フォーマットを使用するモデルをサ
ポートし,アプリケーションの計算コストの90%を節約することができる
• 2019 年に提供開始予定で,Amazon SageMaker,Amazon EC2,Amazon Elastic
Inference が対応
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
推論
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Step Functions API Connectors
Step Functions のステートマシンから他のAWS
サービス群に対して直接操作できるようになり,
前処理〜ジョブ実行〜デプロイの流れをより便
利に行えるように
• DynamoDB: 既存のテーブルからitemの取り出し,新規item
の追加
• AWS Batch: バッチジョブの開始と完了待機
• Amazon ECS/Fargate: ECSまたはFargateのタスクを実行
• Amazon SNS: SNSトピックにメッセージをパブリッシュ
• Amazon SQS: キューにメッセージをプッシュ
• AWS Glue: ジョブを開始
• Amazon SageMaker: 学習ジョブ、変換ジョブを開始
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Airflow Operator サポート
• Airflow 1.10.1 より,SageMaker Operator をサポート
• 既存の Airflow 環境から,SageMaker を読んでパイプラインを構築する
ことがより簡単に
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/workflow/README.rst
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
開発 学習 推論
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Github / CodeCommit インテグレーション
• SageMaker のノートブックインスタンスが,Github および CodeCommit と統合さ
れた形で利用可能になった
• JupyterLab モードから GUI で利用可能
• Git リポジトリを紐づけてノートブックインスタンスを起動することで,最初から
当該リポジトリが含まれた状態で開発を始められる
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Tensorflow コンテナがスクリプトモードと Python 3 に対応
• 従来の SageMaker では model_fn, train_input_fn, eval_input_fn とコン
ポーネントを分けて記述する必要があった
• これが __main__ の中に直接モデル定義とデータ読み込み,学習処理をす
べて書けるようになったので,既存の Tensorflow スクリプトをそのまま
持ってきて動かすことが容易になった
• あわせて tf.keras を使うことで,既存の Keras コードを移植して学習さ
せることも容易に
• また従来の Python 2 だけでなく,Tensorflow 1.11 以降ではPython 3 に
対応
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ビルトインアルゴリズムに
セマンティックセグメンテーションが追加
• セマンティックセグメンテーションは,ピクセル単位で画像の領域が何
かを判定するもの
• Image Classification, Object Detection と並んでよく行われる画像認識の
手法
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
学習ジョブに対して高度な検索を行える
Search 機能(ベータ)が追加
• アルゴリズム,ハイパーパラメータ設定,学習データ,タグ等で,合致するデータ
を検索することが可能
• 検索結果を Accuracy や Loss 等のメトリクスでソートすることが可能
• デプロイされたモデルについて,どのデータが使われたかという Linage をトレー
スすることも可能
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
実際の機械学習のプロセス
開発
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
非常に高速な学習のための GPU インスタンス
• C5n インスタンス同様,最大 100Gbps のネットワーク性能
• ENA ドライバが必要
• 1 セッションでは 5Gbps が上限なので,通信真の多重化を考慮する必要あり
• 32GB 版 NVIDIA® Tesla® V100 GPU を 8 個,Intel® Xeon® Scalable (Skylake) の
96v CPU を搭載
• 2x900GB の NVMe SSD でディスクアクセスもさらに高速に
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
強化学習
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
機械学習の分類
ラベルや値を学習
正解あり
ラベルや値を学習
正解なし
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
機械学習の分類
ラベルや値を学習
正解あり
ラベルや値を学習
正解なし
「方策」を学習
正解なし
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
機械学習の分類
ラベルや値を学習
正解あり
ラベルや値を学習
正解なし
「方策」を学習
正解なし
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
強化学習 (Reinforcement Learning) とは
• 定義された「環境」の中で,「エージェント」が「行動」したフィード
バックとして「報酬」を受け取るステップを,何度も繰り返し,最終的
に良い結果を目指す
• 報酬は,ポジティブなものだけではなくネガティブなものもある
• 最終的に良い結果につながる行動には,ポジティブな報酬
• 最終的に悪い結果につながる行動には,ネガティブな報酬
• 例: 将棋
• 環境: 8x8 のマス目と,多くの種類の駒,およびルール
• エージェント: 将棋の指し手 2 名
• 行動: 駒を動かす
• 報酬: 勝ち負け
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SageMaker で強化学習のサポート
• Amazon SageMaker RL は,強化学習を行うための機能拡張
• 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 など)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SageMaker の強化学習でオートスケーリングの最適化
• 環境: ロードプロファイルと稼働インスタンス数
• 行動: インスタンスの起動 or 停止
• 報酬: 費用 + トランザクション成功率.キャパシティ不足の際は大きなペナルティ
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DeepRacer – 強化学習のためのラジコンカー
• AWS DeepRacer は,1/18 スケールの 4 輪ラジコンカー
• 開発者が強化学習を始める際に,ハンズオンを行えるようにするためのもの
仕様
• 1/18 スケールラジコンカー
• Intel Atom プロセッサ
• 4Mピクセル, 1080p カメラ
• WiFi (802.11ac)
• OS を動かすバッテリーは 2h 以上稼働
• Ubuntu 16.04LTS, ROS (Robot
Operating System), OpenVino
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DeepRacer の構成と関連サービス
• Amazon SageMaker で強化学習のトレーニング
を行うことが可能
• AWS RoboMaker による 3D シミュレーション環
境を用いて,トレーニングした結果の評価を行
い,良かったものを実機で走らせる
• AWS DeepRacer リーグを開催.AWS 各地のサ
ミットでレーシングイベントを開催するととも
に,オンラインのイベントやトーナメントも実
施.成績上位者は re:Invent 2019 で行われるチャ
ンピオンカップに集結
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
価格
• Amazon.com にて,$399.00 のところが今なら期間限定で $249.00 で予
約受付中.2019/3/6 発売予定
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
まとめ
1. 万人が対象 API サービス - 誰でも機械学習技術を活用できるように
• 自分たちのデータで時系列予測・パーソナライズを簡単に行える新サービスが登場
• 医療用自然言語解析,OCR といった,既存の言語・画像領域のサービスも拡大
2. [機械学習] 技術者が対象 ML パイプライン - 機械学習のあらゆるプロセスを便利
に
• アノテーション,モデル変換,GPU 推論の最適化,ワークフロー管理など,ML パイプライ
ンをエンドツーエンドでサポートするようなサービスを提供
• 従来開発・の学習・推論プロセスに関しても,より多くの機能を提供
3. 機械学習技術者が対象 強化学習 – 機械学習の新たな領域
• Amazon SageMaker が強化学習をサポートし,他サービスとも連携
• AWS DeepRacer によって,強化学習の第一歩を踏み出すことがより簡単に
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Makoto Shimura
makotosh@amazon.co.jp

re:Invent 2018 ML サービスアップデート

  • 1.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Machine Learning Services Update Makoto Shimura Solution Architect AWS re:In ven t 2018
  • 2.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Machine Learning Services Stack
  • 3.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 今回のアップデートの概要 1. 万人が対象 API サービス - 誰でも機械学習技術を活用できるように 2. [機械学習] 技術者が対象 ML パイプライン - 機械学習のあらゆるプロセスを便利に 3. 機械学習技術者が対象 強化学習 – 機械学習の新たな領域
  • 4.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. API サービス
  • 5.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Machine Learning Services Stack
  • 6.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 7.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Personalize – easy-to-use なパーソナライズ • Amazon Personalize は機械学習のエキスパートでない人向けの,レコメンデー ションやパーソナライゼーションが簡単に行えるサービス • Amazon が培ったレコメンデーションのナレッジを活用して,データを入れたら自 動でレコメンド・パーソナライズの結果を取得可能 • 既存サービスに簡単にレコメンド機能を追加できるように
  • 8.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Personalize の利用イメージ • 以下のようなユースケースに適用可能 • ユーザーの行動ログデータをベースとしたレコメンデーションを実行 • ユーザーごとに検索結果をパーソナライズして,表示順序を変更 • ノーティフィケーションをパーソナライズした形で実行 • バッチデータとストリームデータの両方に対応 • バッチデータは S3 から「ユーザー x 商品」行列形式のデータを取り込む • ストリームデータは AWS Amplify か AWS SDK 経由でデータを送信
  • 9.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格 • データ量,学習数,推論数に応じて課金 • 提供リージョン • バージニア北部 • オレゴン • ステータス • 以下のページからプレビュー申請可能 https://pages.awscloud.com/AmazonPersonalizePreview.html
  • 10.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 11.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Forecast – easy-to-use な時系列予測サービス • Amazon Forecast は機械学習のエキスパートでない人向けの,時系列データの予測 を簡単に行えるサービス • Amazon が培った時系列予測のナレッジを活用して,データを入れたら自動で時系 列予測の結果を表示 • ウェブトラフィック,売上データ,商品需要,小売における製品値引きやプロモー ションの効果などを予測する際に役立つ
  • 12.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格 • 作成した予測数,保存データ量,学習にかかった時間の 3 要素に応じて課金 • 提供リージョン • バージニア北部 • オレゴン • ステータス • 以下のページからプレビュー申請可能 https://pages.awscloud.com/AmazonForecast-Preview.html
  • 13.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 14.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Comprehend Medical – メディカルデータ対応 • 文章から様々な情報を抽出する,自然言語理解サービス Amazon Comprehend の拡張サービスで,メディカルデータ向けのチューニング を行なったもの • 症状,治療法,薬等の医療用語,略語に対応できるように追加学習済み • 医療上の文脈やエンティティの関係性を認識 • Protected health Information (PHI) を抜き出す API も用意.ただし 100 % の精度で検出できるわけではないので,その点に注意して使用す る必要あり
  • 15.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Comprehend Medical の利用イメージ • 症状や治療法のようなエンティティを認識 • 文章構造をみて,単語間の関係性も認識することが可能
  • 16.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格 • $0.01/unit : Medical Named Entity and Relationship Extraction API • $0.0014/unit : Medical PHI Data Extraction and Identification API • 1 unit は 100 文字 • 対応言語 • 英語 • 提供リージョン • バージニア北部 • オレゴン • オハイオ • アイルランド
  • 17.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 18.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Textract – 文章構造も認識可能な OCR 概要 • Amazon Textract は高機能な OCR を提供 • 見出し,ヘッダー,フォーム,テーブル等の構造情報 も認識 • 既存の OCR にあるような文書章フォーマットのテン プレートをメンテナンスする必要はない 価格 • $1.50 / 1000 pages ステータス • 以下のページからプレビュー申請可能 https://pages.awscloud.com/textract-preview.html
  • 19.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 20.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Translate Custom Terminology – カスタム語彙 • Amazon Translate は高機能な多言語 間翻訳サービス • ただ固有名詞等,決まった特定の形 で処理をしたいものに関しては,必 ずしもうまく対応できなかった • カスタム語彙を追加することで,こ の問題に対応できるように • ただし多用しすぎると翻訳の質を逆に下げてし まう • 商品名,固有名詞のような常に一定の規則で変 換されるもの留めることを推奨 • 言語ごとのカスタム語彙利用推奨, 非推奨は右図の通り
  • 21.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 22.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. ML Models in AWS Marketplace – 機械学習モデルのマーケットプレイスを新たに提供開始 • さまざまな会社が提供する機械 学習モデルを,マーケットプレ イス経由でサブスクライブし, Amazon SageMaker の学習 ジョブおよび,推論エンドポイ ントやバッチ推論ジョブで利用 可能に • 200 以上のアルゴリズムがすで に公開済み • 自社アルゴリズムの販売も当然 可能
  • 23.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. SageMaker でのマーケットプレイスモデルの利用 学習ジョブ実行時 モデル作成時
  • 24.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Machine Learning Services Stack
  • 25.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. ML パイプライン
  • 26.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 機械学習の分類 ラベルや値を学習 正解あり ラベルや値を学習 正解なし
  • 27.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 一般的な機械学習のプロセス
  • 28.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス
  • 29.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. データ 準備 実際の機械学習のプロセス
  • 30.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 機械学習の分類 ラベルや値を学習 正解あり ラベルや値を学習 正解なし
  • 31.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 32.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon SageMaker Ground Truth – 効率的アノテーション作業の支援サービス • Amazon SageMaker Ground Truth は,機械学習の正解データ作成(アノ テーションと呼ばれる)作業をサポートするマネージドサービス • 画像や文章に正解ラベルを付与するのは,非常に手間のかかるプロセス だが,精度の高い正解データ作成は,機械学習活用には必須 • 例えば以下のようなアノテーションを実行可能 • 画像分類(ネコ画像とイヌ画像を分類) • 物体検出(画像内の複数の物体を,物体の範囲を四角形で囲む形で検出) • セマンティックセグメンテーション(ピクセルレベルで画像内の領域を分割) • テキスト分類(ポジティブな文章とネガティブな文章を分類) • 自分で定義したさまざまなタスク
  • 33.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Ground Truth によるアノテーション • ピクセル単位,バウンディングボックス等さまざまなタスクに対応 • アクティブラーニングによる効率的なアノテーション • ツールを提供するだけでなく,以下のアノーテターを選択可能 • 自社リソース • 3rd パーティ • Amazon Mechanical Turk
  • 34.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. アノテーション作業と結果のチェック
  • 35.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格 • Amazon Mehcanical Turk および 3rd パーティベンダーのアノテーターを使用するときには, その利用料が別途かかる • 提供リージョン • バージニア北部 • オレゴン • オハイオ • アイルランド • 東京
  • 36.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス モデル 変換
  • 37.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 38.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon SageMaker Neo – 各種フレームワーク対応のモデル変換 • Amazon SageMaker Neo は Tensorflow や PyTorch などの Deep Learning フレームワークで学習 したモデルを, EC2 インスタンスや Greengrass デバイス上で高速に動作するように変換する サービス • モデルの速度は最大 2 倍に(もちろん予測精度を一切下げることなく) • 従来のフレームワーク上で 500MB-1GB あるようなモデルが,Amazon SageMaker Neo Runtime 上で 1MB 程度のサイズに • Apache Software License で OSS として提供
  • 39.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Neo の対応フレームワークとプラットフォーム • 対応フレームワーク • Tensorflow • Apache MXNet • PyTorch • ONYX • XGBoost • 対応プラットフォーム • EC2 インスタンス(ml.c5, ml.c4, ml.m5, ml.m4, ml.p3, ml.p2) • デバイス • ARM Cortex-A, Intel Atom, Nvidia Jetson) • Cadence, Qualcomm, Xilinx にも対応予定
  • 40.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格 • 無料 • 提供リージョン • バージニア北部 • オレゴン • アイルランド
  • 41.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス 推論
  • 42.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 43.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon Elastic Inference –GPU による推論を安価に • Amazon Elastic Inference は GPU リソースを 推論演算ごとに細切れで利用可能とすること で,推論にかかる費用を削減しながら高速な 推論を行えるサービス • 現在の GPU は,主に学習プロセスに最適化 されており,これを推論で用いる場合,コス ト的な無駄が生じやすかった • 推論に適した CPU / メモリの EC2 インスタン スを選んだ上で,GPU のスループットを得る ための EIA (Elastic Inference Accelerator) を以 下の 3 つから選択 • eia1.medium: 8TFLOPS の混合精度演算 • eia1.large: 16TFLOPS の混合精度演算 • eia1.xlarge: 32TFLOPS の混合精度演算
  • 44.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. CPU インスタンスの計算を GPU でアクセラレート • ワークロードに応じた最適なリソース配分 • 画像処理:more GPU, CPU, and Memory • 音声認識:less GPU, more CPU and Memory • たとえば画像分類の推論処理をする場合,コストを下げながら十分なパ フォーマンスを得ることが可能 インスタンス EIA 推論速度 (msec) 価格 ($/hour) c5.large なし 230 msec $0.085 c5.large eia1.medium 46 msec $0.22 p2.xlarge なし 42 msec $0.90
  • 45.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格と提供リージョン • 価格(東京リージョン) • eia1.medium: $0.308/h • eia1.large: $0.630/h • eia1.xlarge: $1.246/h • 提供リージョン • バージニア北部 • オハイオ • オレゴン • アイルランド • ソウル • 東京
  • 46.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 47.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Inferentia – 機械学習の推論チップ • AWS Inferentia は,低コストで高性能を実現するように設計された機械学習の推論 チップ • TensorFlow,Apache MXNet,PyTorch ONNX フォーマットを使用するモデルをサ ポートし,アプリケーションの計算コストの90%を節約することができる • 2019 年に提供開始予定で,Amazon SageMaker,Amazon EC2,Amazon Elastic Inference が対応
  • 48.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス 推論
  • 49.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 50.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS Step Functions API Connectors Step Functions のステートマシンから他のAWS サービス群に対して直接操作できるようになり, 前処理〜ジョブ実行〜デプロイの流れをより便 利に行えるように • DynamoDB: 既存のテーブルからitemの取り出し,新規item の追加 • AWS Batch: バッチジョブの開始と完了待機 • Amazon ECS/Fargate: ECSまたはFargateのタスクを実行 • Amazon SNS: SNSトピックにメッセージをパブリッシュ • Amazon SQS: キューにメッセージをプッシュ • AWS Glue: ジョブを開始 • Amazon SageMaker: 学習ジョブ、変換ジョブを開始
  • 51.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Airflow Operator サポート • Airflow 1.10.1 より,SageMaker Operator をサポート • 既存の Airflow 環境から,SageMaker を読んでパイプラインを構築する ことがより簡単に https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/workflow/README.rst
  • 52.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス 開発 学習 推論
  • 53.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 54.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Github / CodeCommit インテグレーション • SageMaker のノートブックインスタンスが,Github および CodeCommit と統合さ れた形で利用可能になった • JupyterLab モードから GUI で利用可能 • Git リポジトリを紐づけてノートブックインスタンスを起動することで,最初から 当該リポジトリが含まれた状態で開発を始められる
  • 55.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Tensorflow コンテナがスクリプトモードと Python 3 に対応 • 従来の SageMaker では model_fn, train_input_fn, eval_input_fn とコン ポーネントを分けて記述する必要があった • これが __main__ の中に直接モデル定義とデータ読み込み,学習処理をす べて書けるようになったので,既存の Tensorflow スクリプトをそのまま 持ってきて動かすことが容易になった • あわせて tf.keras を使うことで,既存の Keras コードを移植して学習さ せることも容易に • また従来の Python 2 だけでなく,Tensorflow 1.11 以降ではPython 3 に 対応
  • 56.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. ビルトインアルゴリズムに セマンティックセグメンテーションが追加 • セマンティックセグメンテーションは,ピクセル単位で画像の領域が何 かを判定するもの • Image Classification, Object Detection と並んでよく行われる画像認識の 手法
  • 57.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 学習ジョブに対して高度な検索を行える Search 機能(ベータ)が追加 • アルゴリズム,ハイパーパラメータ設定,学習データ,タグ等で,合致するデータ を検索することが可能 • 検索結果を Accuracy や Loss 等のメトリクスでソートすることが可能 • デプロイされたモデルについて,どのデータが使われたかという Linage をトレー スすることも可能
  • 58.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 実際の機械学習のプロセス 開発
  • 59.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 60.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 非常に高速な学習のための GPU インスタンス • C5n インスタンス同様,最大 100Gbps のネットワーク性能 • ENA ドライバが必要 • 1 セッションでは 5Gbps が上限なので,通信真の多重化を考慮する必要あり • 32GB 版 NVIDIA® Tesla® V100 GPU を 8 個,Intel® Xeon® Scalable (Skylake) の 96v CPU を搭載 • 2x900GB の NVMe SSD でディスクアクセスもさらに高速に
  • 61.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 強化学習
  • 62.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 機械学習の分類 ラベルや値を学習 正解あり ラベルや値を学習 正解なし
  • 63.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 機械学習の分類 ラベルや値を学習 正解あり ラベルや値を学習 正解なし 「方策」を学習 正解なし
  • 64.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 機械学習の分類 ラベルや値を学習 正解あり ラベルや値を学習 正解なし 「方策」を学習 正解なし
  • 65.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 強化学習 (Reinforcement Learning) とは • 定義された「環境」の中で,「エージェント」が「行動」したフィード バックとして「報酬」を受け取るステップを,何度も繰り返し,最終的 に良い結果を目指す • 報酬は,ポジティブなものだけではなくネガティブなものもある • 最終的に良い結果につながる行動には,ポジティブな報酬 • 最終的に悪い結果につながる行動には,ネガティブな報酬 • 例: 将棋 • 環境: 8x8 のマス目と,多くの種類の駒,およびルール • エージェント: 将棋の指し手 2 名 • 行動: 駒を動かす • 報酬: 勝ち負け
  • 66.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 67.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. Amazon SageMaker で強化学習のサポート • Amazon SageMaker RL は,強化学習を行うための機能拡張 • 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 など)
  • 68.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. SageMaker の強化学習でオートスケーリングの最適化 • 環境: ロードプロファイルと稼働インスタンス数 • 行動: インスタンスの起動 or 停止 • 報酬: 費用 + トランザクション成功率.キャパシティ不足の際は大きなペナルティ
  • 69.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 70.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS DeepRacer – 強化学習のためのラジコンカー • AWS DeepRacer は,1/18 スケールの 4 輪ラジコンカー • 開発者が強化学習を始める際に,ハンズオンを行えるようにするためのもの 仕様 • 1/18 スケールラジコンカー • Intel Atom プロセッサ • 4Mピクセル, 1080p カメラ • WiFi (802.11ac) • OS を動かすバッテリーは 2h 以上稼働 • Ubuntu 16.04LTS, ROS (Robot Operating System), OpenVino
  • 71.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. AWS DeepRacer の構成と関連サービス • Amazon SageMaker で強化学習のトレーニング を行うことが可能 • AWS RoboMaker による 3D シミュレーション環 境を用いて,トレーニングした結果の評価を行 い,良かったものを実機で走らせる • AWS DeepRacer リーグを開催.AWS 各地のサ ミットでレーシングイベントを開催するととも に,オンラインのイベントやトーナメントも実 施.成績上位者は re:Invent 2019 で行われるチャ ンピオンカップに集結
  • 72.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 価格 • Amazon.com にて,$399.00 のところが今なら期間限定で $249.00 で予 約受付中.2019/3/6 発売予定
  • 73.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved.
  • 74.
    © 2018, AmazonWeb Services, Inc. or its affiliates. All rights reserved. まとめ 1. 万人が対象 API サービス - 誰でも機械学習技術を活用できるように • 自分たちのデータで時系列予測・パーソナライズを簡単に行える新サービスが登場 • 医療用自然言語解析,OCR といった,既存の言語・画像領域のサービスも拡大 2. [機械学習] 技術者が対象 ML パイプライン - 機械学習のあらゆるプロセスを便利 に • アノテーション,モデル変換,GPU 推論の最適化,ワークフロー管理など,ML パイプライ ンをエンドツーエンドでサポートするようなサービスを提供 • 従来開発・の学習・推論プロセスに関しても,より多くの機能を提供 3. 機械学習技術者が対象 強化学習 – 機械学習の新たな領域 • Amazon SageMaker が強化学習をサポートし,他サービスとも連携 • AWS DeepRacer によって,強化学習の第一歩を踏み出すことがより簡単に
  • 75.
    Thank you! © 2018,Amazon Web Services, Inc. or its affiliates. All rights reserved. Makoto Shimura makotosh@amazon.co.jp