SlideShare a Scribd company logo
Inspection
of
Cloud Machine Leaning
Hyper Parameter Tuning
nagachika
GCPUG Fukuoka
Agenda
• Hyper Parameter Tuning とは?
• Hyper Parameter Tuning の性能を実験
• Hyper Parameter Tuning の探索⽅法を推測
About me
• nagachika
• Ruby committer, Stable branch maintainer
• Fukuoka.rb organizer
• GCPUG
• TFUG (TensorFlow User Group)
• TensorFlow contributor ← NEW
Pull Requests to TensorFlow
Cloud Machine Learning
Cloud Machine Leaning
• Training
• TensorFlow が(分散環境、GPU環境含め)

⽤意されている実⾏環境のホスティングサービス
• TensorFlow 専⽤のPaaS(Heroku)
• Prediction
• TensorFlow Serving のホスティングサービス
• API で Training したモデルを利⽤できる
Hyper Parameter Tuning
Hyper Parameter Tuning
• Hyper Parameter とは?
• モデル(SVM, Random Forest, MLP, CNN 等々なんであれ)の学習に

先⽴って決定しないといけないパラメータ
• モデルの精度に影響する
• より良い Hyper Parameter の探索が望ましい
Hyper Parameter Tuning
• Machine Learning Model
Input Output
Hyper Parameter Tuning
• Machine Learning Model
Dog or Cat
Hyper Parameter Tuning
• Machine Learning Model
Input Output
トレーニング可能な
パラメータ
トレーニング不可な
パラメータ
期待する Output が得られるように

トレーニング可能なパラメータを

変更するのが

(教師あり)機械学習における

「学習」
Hyper Parameter Tuning
• Machine Learning Model
Input Output
トレーニング可能な
パラメータ
トレーニング不可な
パラメータ
Expectation
Error
期待(Expectation)と実際の
Outputの差を定量化したもの
(Error)を最⼩にする。

勾配を⽤いた⼿法が主流
Hyper Parameter Tuning
• Machine Learning Model
Input Output
トレーニング可能な
パラメータ
トレーニング不可な
パラメータ
Expectation
Error
Hyper Parameter Tuning
• Machine Learning Model
Input
(Hyper Parameter)
Output

(Error)
Hyper Parameter を⼊⼒として

誤差(Error)を出⼒とする関数とみなすこともできる

↓
Output(Error)を最⼩にする Input(Hyper Parameter)を

探索する最適化問題
Hyper Parameter Tuning
• Machine Learning Model
Input
(Hyper Parameter)
Output

(Error)
ただし、⼀般的に
• 勾配はわからない(そもそもInputが距離の概念がある空間と限らない)
• F(x) の評価には時間がかかる
Hyper Parameter Tuning
• Derivative-free optimization

(勾配によらない最適化⼿法)
• Simulated Annealing(焼きなまし法)
• Genetic Algorithm(遺伝的アルゴリズム)
→ ⼤量の試⾏が必要で実⾏コストが⼤きい
Hyper Parameter Tuning
• Scikit learn
• Grid Search(グリッドサーチ)
• パラメータ毎に有限の候補の組み合わせ試⾏
• Random Search(ランダム探索)
→ シンプルだけどいまいち賢くない
Hyper Parameter Tuning
Cloud Machine Learning の

Hyper Parameter Tuning は

どんな⽅法で探索を

しているのだろうか?
Motivation
Motivation
• 多層ニューラルネットワーク
• 層の数
• (各層の)ユニット(ニューロン)の数
• etc…
Layer-1 Layer-2
Motivation
• 層の数
• (各層の)ユニット(ニューロン)の数
➡ 1つのパラメータで表現したいな
➡ 極度に多峰的な関数になりそう…
Motivation
• 多峰性関数→最適化が困難な性質
➡ Cloud Machine Learning はこんな関数に対して

どのくらい賢く最適化してくれるんだろう?
単峰性関数 多峰性関数
実験1
実験1
• Cloud Machine Learning に Hyper Parameter
Tuning で 既知の関数の最適化をさせる
• F(x) を明⽰的に式として与える
• Hyper Parameter を受け取って F(x) を計算し
て報告するだけの Python モジュールを作成
実験1
• Hyper Parameter
• 1変数(x), 2変数(x, y)
• 範囲は全て [-1, 1]
• 最⼩値を求める
• 探索回数(N)は
• 1変数 → N=10 or 15
• 2変数 → N=30
実験1
N=10
実験1
N=10
実験1
N=10
実験1
N=15
実験1
N=15
実験1
実験1
N=30
実験1
Ackley 関数
実験1
Ackley 関数 N=30
実験1
• あきらかに Grid Search ではない
• 低次元の多項式(?)くらいだとかなり賢い

(少ない試⾏回数で最適値の近くを当てる)
• 難しい形状の関数もそれなりに

(⼤域探索している? 局所解に落ちたりはなさそう)
➡ どうやってるんだろう???
Bayesian Optimization

ベイズ最適化
Bayesian Optimization
http://mathetake.hatenablog.com/entry/2016/12/19/145311
Bayesian Optimization
https://www.youtube.com/watch?v=pQHWew4YYao
ベイズ的最適化の⼊⾨と応⽤
機械学習による機械学習の実験計画
Bayesian Optimization
おおざっぱな理解では
• 既に得た⼊⼒の結果を元に推測しつつ
• まだ調べてないあたりも調べるようにしつつ
いい感じに探索するために、

最適化したい関数の形状を(各⼊⼒に対する)

確率分布として捉える。
Bayesian Optimization
• 関数を確率分布として捉える?
Bayesian Optimization
• 関数を確率分布として捉える?
• x をある値に固定した時にF(x)が取る値を確率分布
• 既知の⼊⼒ x = x1, x2, … を元に計算する
Bayesian Optimization
• Acquisition function
• 次にテストすべき点を決めるための

「重要度」みたいなのを決める関数
• GP-UCB
平均 分散
= 活⽤ = 探索
実験2
実験2
• 実験1と同じF(x)に対して Bayesian Optimization
• 最初の3点は実験1の(Cloud MLの)結果を流⽤

(Bayesian Optimization は初期何点かはランダム探索)
• PythonのBayesianOptimizationパッケージを利⽤

[https://github.com/fmfn/BayesianOptimization]
• Acquisition function には GP-UCB, kappa=0.5 を選択
実験2
N=10
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
N=10
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
N=10
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
N=15
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
N=15
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
実験2
N=30
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
Ackley 関数
実験2
N=30
Cloud Machine Learning
Hyper Parameter Tuning
BayesianOptimization
実験2
• Bayesian Optimization > Grid Search
• Cloud Machine Learning の Hyper Parameter
Tuning と似ているといえなくもない?
• Bayesian Optimization⾃体にも

Hyper Parameterがある(acquisition function
の選択, そのパラメータ etc..)
Summary
• Cloud Machine Learning のHyper Parameter
Tuning はかしこくて便利
• Hyper Parameter に対して複雑な関数になる時は

多めに試⾏回数を取ろう
• Hyper Parameter Tuning の裏側は

Bayesian Optimization?
• オレオレ Cloud Machine Learning の構築も夢では
ない!?

More Related Content

PDF
mxnetで頑張る深層学習
PPTX
ぼくの実装した最弱のディープラーニング
PDF
性能測定道 実践編
PDF
Introduction to Chainer (LL Ring Recursive)
PDF
日本神経回路学会セミナー「DeepLearningを使ってみよう!」資料
PDF
2015年9月18日 (GTC Japan 2015) 深層学習フレームワークChainerの導入と化合物活性予測への応用
PPTX
ChainerでDeep Learningを試すために必要なこと
PDF
PFI Christmas seminar 2009
mxnetで頑張る深層学習
ぼくの実装した最弱のディープラーニング
性能測定道 実践編
Introduction to Chainer (LL Ring Recursive)
日本神経回路学会セミナー「DeepLearningを使ってみよう!」資料
2015年9月18日 (GTC Japan 2015) 深層学習フレームワークChainerの導入と化合物活性予測への応用
ChainerでDeep Learningを試すために必要なこと
PFI Christmas seminar 2009

What's hot (20)

PDF
性能測定道 事始め編
PDF
ディープラーニング最近の発展とビジネス応用への課題
PDF
Stochastic Gradient MCMC
PDF
Kaggleのテクニック
PDF
Microsoft Malware Classification Challenge 上位手法の紹介 (in Kaggle Study Meetup)
PDF
Chainer の Trainer 解説と NStepLSTM について
PDF
Introduction to Chainer and CuPy
PPTX
量子コンピュータで金融計算
PDF
量子コンピュータで金融計算
PPTX
Kaggle参加報告: Champs Predicting Molecular Properties
PDF
Chainerの使い方と自然言語処理への応用
PDF
第3回機械学習勉強会「色々なNNフレームワークを動かしてみよう」-Keras編-
PDF
2015-11-17 きちんと知りたいApache Spark ~機械学習とさまざまな機能群
PDF
アドテク×Scala×パフォーマンスチューニング
PDF
2018年01月27日 TensorFlowの計算グラフの理解
PDF
リアルタイム処理エンジン Gearpumpの紹介
PDF
[DL輪読会]Parallel WaveNet: Fast High-Fidelity Speech Synthesis
PDF
広告配信現場で使うSpark機械学習
PPTX
北大調和系 DLゼミ A3C
PPTX
猫でも分かるVariational AutoEncoder
性能測定道 事始め編
ディープラーニング最近の発展とビジネス応用への課題
Stochastic Gradient MCMC
Kaggleのテクニック
Microsoft Malware Classification Challenge 上位手法の紹介 (in Kaggle Study Meetup)
Chainer の Trainer 解説と NStepLSTM について
Introduction to Chainer and CuPy
量子コンピュータで金融計算
量子コンピュータで金融計算
Kaggle参加報告: Champs Predicting Molecular Properties
Chainerの使い方と自然言語処理への応用
第3回機械学習勉強会「色々なNNフレームワークを動かしてみよう」-Keras編-
2015-11-17 きちんと知りたいApache Spark ~機械学習とさまざまな機能群
アドテク×Scala×パフォーマンスチューニング
2018年01月27日 TensorFlowの計算グラフの理解
リアルタイム処理エンジン Gearpumpの紹介
[DL輪読会]Parallel WaveNet: Fast High-Fidelity Speech Synthesis
広告配信現場で使うSpark機械学習
北大調和系 DLゼミ A3C
猫でも分かるVariational AutoEncoder
Ad

Viewers also liked (20)

PDF
自分たちでつくった"UXガイドライン"を片手に、クラウドワークスを作り変える。
PDF
強化学習@PyData.Tokyo
PDF
Convolutional Neural Netwoks で自然言語処理をする
PDF
aiconf2017okanohara
PDF
Distributed Deep Q-Learning
PDF
Ruby Kaja のご提案
PDF
データレイクを基盤としたAWS上での機械学習サービス構築
PDF
Deep learningの概要とドメインモデルの変遷
PDF
Hype vs. Reality: The AI Explainer
PDF
131026 kansai-emacs
PPTX
A Reintroduction To Ruby M17 N
PPT
Machine Learning Methods for Parameter Acquisition in a Human ...
PPTX
MALT: Distributed Data-Parallelism for Existing ML Applications (Distributed ...
PDF
Spark Summit EU talk by Rolf Jagerman
PDF
tofu - COOKPAD's image system
PDF
Japanese Rubyists you have not met yet
PDF
How to Begin to Develop Ruby Core
PDF
How To Select Best Transmission For Your Vehicle
PDF
福岡商工会議所講演会(2017年2月17日)
PPT
企画案
自分たちでつくった"UXガイドライン"を片手に、クラウドワークスを作り変える。
強化学習@PyData.Tokyo
Convolutional Neural Netwoks で自然言語処理をする
aiconf2017okanohara
Distributed Deep Q-Learning
Ruby Kaja のご提案
データレイクを基盤としたAWS上での機械学習サービス構築
Deep learningの概要とドメインモデルの変遷
Hype vs. Reality: The AI Explainer
131026 kansai-emacs
A Reintroduction To Ruby M17 N
Machine Learning Methods for Parameter Acquisition in a Human ...
MALT: Distributed Data-Parallelism for Existing ML Applications (Distributed ...
Spark Summit EU talk by Rolf Jagerman
tofu - COOKPAD's image system
Japanese Rubyists you have not met yet
How to Begin to Develop Ruby Core
How To Select Best Transmission For Your Vehicle
福岡商工会議所講演会(2017年2月17日)
企画案
Ad

Similar to Inspection of CloudML Hyper Parameter Tuning (20)

PDF
明治大学講演資料「機械学習と自動ハイパーパラメタ最適化」 佐野正太郎
PDF
20210427 grass roots_ml_design_patterns_hyperparameter_tuning
PDF
Practical recommendations for gradient-based training of deep architectures
PDF
機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)
PDF
ハイパーパラメータ調整の労力と効果
PDF
160924 Deep Learning Tuningathon
PPTX
[DL輪読会]EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
DOCX
深層学習 Day1レポート
PDF
ディープラーニング入門 ~ 画像処理・自然言語処理について ~
PPTX
ベイズ最適化によるハイパラーパラメータ探索
PDF
TensorFlow User Group #1
PPTX
Azure Machine Learning Services 概要 - 2019年3月版
PDF
[DL Hacks] Deterministic Variational Inference for RobustBayesian Neural Netw...
PDF
Journal club dec24 2015 splice site prediction using artificial neural netw...
PDF
20170422 数学カフェ Part1
PDF
Hyperoptとその周辺について
PPTX
PRML Chapter 5
PDF
GCPUG Sapporo vol.2 ML Night
PDF
論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)
PDF
AI Business Challenge Day 20170316
明治大学講演資料「機械学習と自動ハイパーパラメタ最適化」 佐野正太郎
20210427 grass roots_ml_design_patterns_hyperparameter_tuning
Practical recommendations for gradient-based training of deep architectures
機械学習プロジェクトにおける Cloud AI Platform の使い方 (2018-11-19)
ハイパーパラメータ調整の労力と効果
160924 Deep Learning Tuningathon
[DL輪読会]EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
深層学習 Day1レポート
ディープラーニング入門 ~ 画像処理・自然言語処理について ~
ベイズ最適化によるハイパラーパラメータ探索
TensorFlow User Group #1
Azure Machine Learning Services 概要 - 2019年3月版
[DL Hacks] Deterministic Variational Inference for RobustBayesian Neural Netw...
Journal club dec24 2015 splice site prediction using artificial neural netw...
20170422 数学カフェ Part1
Hyperoptとその周辺について
PRML Chapter 5
GCPUG Sapporo vol.2 ML Night
論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)
AI Business Challenge Day 20170316

More from nagachika t (13)

PDF
Make Ruby Differentiable
PDF
All bugfixes are incompatibilities
PDF
Functional Music Composition
PDF
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
PDF
Magellan on Google Cloud Platform
PDF
CRuby Committers Who's Who in 2013
PDF
CRuby_Committers_Whos_Who_in_2014
PDF
怠惰なRubyistへの道 fukuoka rubykaigi01
PPTX
Ruby on azure で game server service
PDF
怠惰なRubyistへの道
PDF
Ruby trunk changes 統計版
PDF
Pd Kai#3 Startup Process
PDF
Pd Kai#2 Object Model
Make Ruby Differentiable
All bugfixes are incompatibilities
Functional Music Composition
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
Magellan on Google Cloud Platform
CRuby Committers Who's Who in 2013
CRuby_Committers_Whos_Who_in_2014
怠惰なRubyistへの道 fukuoka rubykaigi01
Ruby on azure で game server service
怠惰なRubyistへの道
Ruby trunk changes 統計版
Pd Kai#3 Startup Process
Pd Kai#2 Object Model

Inspection of CloudML Hyper Parameter Tuning