論文紹介:practical bayesian optimization of machine learning algorithms(nips2012)

38
Keisuke UTO July 26, 2013 論文紹介:Practical Bayesian Optimization of Machine Learning Algorithms(NIPS2012) 1/10/2013 1 @utotch 引用した図、その他の著作権は論文の著者に帰属します http://www.cs.toronto.edu/~jasper/publications.html

Upload: keisuke-uto

Post on 16-Jul-2015

5.393 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Keisuke UTO

July 26, 2013

論文紹介:Practical Bayesian Optimization of Machine Learning Algorithms(NIPS2012)

1/10/2013 1 @utotch

※引用した図、その他の著作権は論文の著者に帰属します

http://www.cs.toronto.edu/~jasper/publications.html

Page 2: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

論文の背景

• 機械学習のアルゴリズムは “rarely parameter free”

• テキトーにデフォルト値を使うのと、綿密にTuningするのでは、性能は雲泥の差

• しかし、Hyperparameter のチューニングは「Black Art」

1/10/2013 2 @utotch

Page 5: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Grid search で解決か?

• 1個1個の点での「学習器のTraingin・性能評価」にかかる計算は普通大きい

• パラメータの数が増えるとさらに増大

問題点 • 各点での計算量・計算時間コストが大のとき非常に問題(評価しなおしたら、論文投稿までに計算が終わらない)

• 形状が複雑な場合、どのような戦略で詳細化するか問題

1/10/2013 5 @utotch

Page 6: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

やりたいこと

• 機械学習の汎化性能を最大にするHyperparameter x をなるべく少ない評価回数で見つける

• あるHyperparameter における学習器の性能指標をf(x)とし、f(x)を最小とするx を見つける

しかし f(x) の正確な形は分からない…

未知の多次元入力関数の大域最小値を最小の評価回数で求めるには、どこを探せばよいか?

1/10/2013 6 @utotch

Page 7: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

• Amazon EC2 • 論文投稿までの日数--

つまり

? )(minarg*xx

x

f

但し

)(xf の評価は非常に時間がかかるので

なるべく少ないサンプルで高速に 大域最小解を求めたい

)(xf :機械学習の性能の悪さ • 形状はよく分からない • 勾配情報は不明 • 非線形・非凸

x は機械学習アルゴリズムのHyperParameter 多次元(1D~10D)

Ex: SVMのC,RBF Kernel のγ, 正則化項のλ, …

good

1/10/2013 7 @utotch

Page 8: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

解法のOverview

? ));(( θxfp

))};,{(|)(( θxx nn yfp

f(x)の事前分布を決める

サンプル点のf(x)を評価し、のf(x)事後分布を決める

)}),{(,( nn ya xx

)}),{(,(maxarg nnnext ya xx

x

x

f(x)の事後分布と、サンプル点から計算される「候補点の良さ」の指標

※実際はMCMCして求める

1/10/2013 8 @utotch

Page 9: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

解法のOverview

(ポイント1)「関数の分布」をどのようにモデル化するか? (ポイント2)「候補点の良さ」をどのような指標で測るか?

Hyperparamter

機械学習の性能の悪さ Hyperparameter を変えたとのコスト関数(機械学習の性能の悪さ)を何らかの手法で(後述)モデル化する ?

「次の候補点の良さ」を定量化した指標をつくり、その最大点をサンプリングする

解法のポイント

1/10/2013 9 @utotch

Page 10: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

関数の分布と次サンプル候補のイメージ

1/10/2013 10 @utotch

Page 11: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

(1)「未知の関数」をどうやってモデル化するか?

1/10/2013 @utotch 11

Page 12: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

「未知の関数」をどうやってモデル化するか?

• Cost function f(x) の形は、分からない • サンプル点のみ分かる

f(x)の事前分布p(f(x))を何らか具体的に表現し、サンプル点が増えるに従ってf(x)の事後分布p(f(x);Sampled Data)を使って次の候補点の目星を付けることができないか?

1/10/2013 12 @utotch

Page 13: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process によるf(x)のイメージ

GPによるf(x)の事前分布 GPによるf(x)の事後分布

2Rx

Rx

Rxf )(

Rf )(x

1/10/2013 13 @utotch

Page 14: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは何か?

1/10/2013 14 @utotch

Page 15: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは

Gaussian Process は無限次元の多変量ガウス分布 (点,ベクトルの分布ではなく)「関数」の分布をモデル化して扱うための道具として使える

※理解途中のなので若干のウソが入るかもしれません。すみません。

1/10/2013 15 @utotch

Page 16: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは

イメージを乱暴に言います

x

)(xf

2

111 ~ f1f

1/10/2013 16 @utotch

Page 17: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは

イメージを乱暴に言います

x

)(xf

2

111 ~ f

1f

2f

2

222 ~ f

1/10/2013 17 @utotch

Page 18: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは

イメージを乱暴に言います

x

)(xf

1f

2f

nf

Σμf ~

1/10/2013 18 @utotch

Page 19: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process とは

• 無限次元の多変量ガウス分布 • 「関数」の分布を表す

x

)(xf

),()(~)( x'xxx kmGPf

GP)(x

無限次元

),( x'xk

1/10/2013 19 @utotch

無限次元の分散共分散行列 またの名を Kernel!

Page 20: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

比較表

Gaussian Distribution Gaussian Process

点,Vector の分布 関数(無限次元のベクトル)の分布

mean

covariance

Mean function

Covariance function = Kernel

Index=i Index=

DRDD RR

RRm D :)(x

RRRk DD ),(:),( x'x

で分布の形が決まる で分布の形が決まる

1/10/2013 20 @utotch

Page 21: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Gaussian Process のイメージ

• 非常に多様な形状(非線形、非凸)の関数を表現可能

• Kernelをデザインすることで関数の形を変えられる

GPによるf(x)の事前分布 GPによるf(x)の事後分布

• データ点の周辺は分散が小

• データ点の増加に応じて関数の形状が詳細化していく

• どこを切ってもガウシアン

1/10/2013 21 @utotch

Page 22: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

f(x)の事前分布をGaussian Processで表現する

)(xm

),( x'xk

:Mean Function

:Covariance Function = Kernel

の2つを決めれば、Gaussian Process の形を既定できる

)(xm

),( x'xk

(詳細な形に関する事前知識はないので)

1/10/2013 22 @utotch

Page 23: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

関数の分布のモデル化

表現される関数f(x)が滑らかすぎたので

1/10/2013 23 @utotch

Page 24: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

(2)「サンプル候補点の良さ」をどうやって測るか?

1/10/2013 24 @utotch

Page 25: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

サンプル候補点の「良さ」をどう測る? Acquisition Function

このへんが最小値ありそう

• 小さいf(x)の近くに最小値はありそう

• 分布が未知の部分には、隠された鉱脈があるかも

サンプル候補点の「良さ」を表す関数:

どうあるべきか?

1/10/2013 25 @utotch

Page 26: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

サンプル候補点の「良さ」をどう測る? Acquisition Function

サンプル候補点の「良さ」を表す関数:

? どこに最小値があると思いますか?

1/10/2013 26 @utotch

Page 27: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

サンプル候補点の「良さ」をどう測る?

Acquisition Function

イメージ

1/10/2013 27 @utotch

Page 28: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

のイメージ ( )EIa x

1/10/2013 28 @utotch

Page 29: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

関数の分布と次サンプル候補のイメージ

1/10/2013 29 @utotch

Page 30: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

サンプル候補点の「良さ」をどう測る?

Acquisition Function

※EI以外にも、Probability of Improvement, Upper Confidence Bound という指標がある。本論文では実験比較で性能の高かったEIを用いている

乱暴な説明

• 新しいサンプル点が最小値となりうる期待値 • サンプル済みの点の評価値と、不確実さを考慮した値

1/10/2013 30 @utotch

Page 31: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

全体のアルゴリズム

1/10/2013 31 @utotch

Page 32: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

モデル

D

m

2

1

0

θ

“Gaussian Process の” Hyperparameter θ ※機械学習のHyperpamameter x ではないので注意

観測ノイズの分散

GPのmean function

GP Kernel の Covariance Amplitude

GP Kernel 内の各次元のScale Paramter

※GP:Gaussian Process

1/10/2013 32 @utotch

Page 33: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

アルゴリズムの概要

1/10/2013 33 @utotch

Page 34: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

Bayesian Optimization

1/10/2013 34 @utotch

Page 35: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

評価:Logistic Regression(MNIST)

4Rx

1/10/2013 35 @utotch

Page 36: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

評価:Structured SVM

• Random Grid Seach よりも速く、良い解を見つけている • Kernel の形が違うと、性能が異なる → 問題毎に適切なKernelがある

3Rx

1/10/2013 36 @utotch

Page 37: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

評価:Convolutional Neural Network

• CIFAR-10 画像データベースを用いた実験 • HumanExpert よりもよい性能

9Rx

1/10/2013 37 @utotch

Page 38: 論文紹介:Practical bayesian optimization of machine learning algorithms(nips2012)

まとめ

要約 • 機械学習のHyperparmeter チューニングを効率良く行う手法 • 未知の多次元入力・非線形・非凸関数の最適化(f(x)の評価コスト大)という問題

• Gaussian Process で「関数の分布」をモデル化し、EI(Expected Improvement) という指標で次の候補点をBayes最適化

• 並列化して効率良く実行することも可能

1/10/2013 38 @utotch