論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online...

33
論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning" Ross, et. al. (CMU), International Conference on Artificial Intelligence and Statistics (AISTATS) 2011 山本遼 チームラボ勉強会 2016/10/13

Transcript of 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online...

Page 1: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

論文紹介"A Reduction of Imitation Learning and Structured

Prediction to No-Regret Online Learning"Ross, et. al. (CMU), International Conference on Artificial Intelligence and Statistics

(AISTATS) 2011

山本遼

チームラボ勉強会 2016/10/13

Page 2: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

強化学習と模倣学習

● 強化学習(Reinforcement Learning)‐ 各時刻 t ごとに、状態 st を観測し、行動 at を決定する

‐ 行動によって得られる報酬 rt を最大化するような

方策(Policy) π : S → A を得たい

‐ エージェントが自ら試行錯誤して学習

● Q学習など

● 模倣学習(Imitation Learning)‐ 熟練者(Expert)が適切なアクションを教える

‐ 実用上の効果が高く、多くの分野でState-of-the-Artを達成

2

Page 3: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

模倣学習(Imitation Learning)● 単純なアプローチ:教師あり学習

‐ 熟練者のふるまいを単純に教師データとして学習

‐ 問題=教師データの偏り

● 例:熟練ドライバーはコースアウトしないので、コースアウトした時

にとるべき行動を学習できない

● 数学的には、π : S → A を学習するための

教師データ D={ (s, a) } の s がi.i.d. (Independent and Identically Distributed) でない

問題

‐ 単純な教師あり学習では良い性能が出ない

● この問題を回避することがこの論文のテーマ3

Page 4: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

変数

Π 方策(policy)の集合

π 方策 π: S → A

S 状態 s の集合

A 行動 a の集合

T 時刻 t の上限

t 時刻1〜t-1まで方策πを用いた場合の、状態sの確率分布

= 1/T・Σt=1...T

t 全Tステップで方策πを用いた場合の、状態sの確率分布平均

C(s, a) 状態 s で行動 a を選択した時の即時コスト。範囲は[0,1] とする

(s)=Ea〜π(s)

[C(s, a)] 状態 s で方策πを用いる場合の即時コスト期待値

全Tステップで方策πを用いた場合の合計コスト期待値 4

Page 5: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

代替損失関数(surrogate loss function)● 模倣学習では、コスト C(s,a) を直接観測しない

‐ コストを下げるのではなく、熟練者に近づくことが直接目標

● 代替損失関数 で、熟練者とのズレを表す

(s, π) = 1 when π(s)=π*(s) else 0 ただしπ*は熟練者の

方策.‐ 多くの場合、Cと は同じ機能を果たす

● 模倣学習のゴールは、下記を満たす方策を求めること

5

Page 6: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

問題の難しさ

● その方策 π のもとでの状態分布 dπ における

代替損失の期待値が小さい π を求める

● 期待値の前提になる状態分布 dπ が、方策 π 自身に依存

● i. i. d. でない

● 全ての s について (s,π) が π について凸だったとしても

非凸の目的関数になってしまう

6

Page 7: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法1. 教師あり学習

7

Page 8: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法1:教師あり学習(Supervised Learning)● 熟練者の方策: π*

熟練者の方策における状態分布 dπ* dπ* 上で代替損失を最小化する方策を学習する

● 熟練者のデータセット D={ (s, a) } を教師データとしてモデルを学習することに相当

‐ 同じ s に対してなるべく同じ a を返す関数を学習する

● 問題:熟練者の状態分布 dπ* に最適化してしまう● 熟練者がほとんどコースアウトしない場合、「コースアウトしない場

合についてはうまく走れる」ようになる 8

Page 9: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法1.教師あり学習の性能上限

学習した方策 π と熟練者の方策 π* の誤差期待値を ε とする

方策 π の期待コスト J(π) は、熟練者の期待コストJ(π*) よりも

最大で T2ε だけ悪くなる(Tは時間ステップ数)

教師あり学習をすると、最大で熟練者より O(T2) だけ悪い性能

長時間のタスクであればあるほど、教師とのズレが蓄積

9

定理

とすると

Page 10: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning

10

Page 11: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning(著者ら, 2010)● 時刻ステップごとに別の方策をとるモデルで考える

● 各時刻ごとに別々に方策を学習していく手法

11

Page 12: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning

12

1 2 3 4 ... ... ... T

0 X X X X X X X X

1

2

3

4

...

...

T

時刻 t →

イテ

レー

ション

i →

X: 熟練者の方策(都度、熟練者に聞く)

← イテレーション0の方策 π0

Page 13: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning

13

1 2 3 4 ... ... ... T

0 X X X X X X X X

1 π11 X X X X X X X

2

3

4

...

...

T

時刻 t →

イテ

レー

ション

i →

X: 熟練者の方策(都度、熟練者に聞く)

イテレーション #1①イテレーション0の方策π0でデータを収集

②そのデータの t=1 の部分だけを使い、 t=1 専用のモデル π1

1 を学習する

③t=1以外については π0 を用いることとし、 これを方策 π1 とする

Page 14: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning

14

1 2 3 4 ... ... ... T

0 X X X X X X X X

1 π11 X X X X X X X

2 π11 π2

2 X X X X X X

3

4

...

...

T

時刻 t →

イテ

レー

ション

i →

X: 熟練者の方策(都度、熟練者に聞く)

イテレーション #2①イテレーション1の方策π1でデータを収集

②そのデータの t=2 の部分だけを使い、 t=2 専用のモデル π2

2 を学習する

③t=2以外については π1 を用いることとし、 これを方策 π2 とする

Page 15: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning

15

1 2 3 4 ... ... ... T

0 X X X X X X X X

1 π11 X X X X X X X

2 π11 π2

2 X X X X X X

3 π11 π2

2 π33 X X X X X

4

...

...

T

時刻 t →

イテ

レー

ション

i →

X: 熟練者の方策(都度、熟練者に聞く)

イテレーション #3①イテレーション2の方策π2でデータを収集

②そのデータの t=3 の部分だけを使い、 t=3 専用のモデル π3

3 を学習する

③t=3以外については π2 を用いることとし、 これを方策 π3 とする

Page 16: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法2. Forward Learning● 各時刻ステップごとに教師データを集めて

学習する手法

● 利点

‐ i. i. d. 問題がなく、性能が良い

‐ 熟練者より最大で O(T) だけ期待コ

ストが大きい方策が得られる

● 欠点

‐ T回のイテレーションを全て回しきらな

いと方策が完成しない

‐ 現実の問題にはほぼ適用できない

16

1 2 3 4 ... ... ... T

0 X X X X X X X X

1 π11 X X X X X X X

2 π11 π2

2 X X X X X X

3 π11 π2

2 π33 X X X X X

...

...

...

T π11 π2

2 π33 π4

4 ... ... ... πTT

時刻 t →

イテ

レー

ション

i →

Page 17: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

Forward Algorithm 擬似コード

17

Page 18: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法3. SMILe

18

Page 19: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法3. SMILe(著者ら, 2010)● Stochastic Mixing Iterative Learning● 確率的に方策を混合しながら学習する

● 現実的な問題に適用可能な手法

19

Page 20: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法3. SMILe

20

π0 = 熟練者

この方策でデータを集めて学習

π0#

π1 = απ0

# + (1-α)π0 π1#

π2 = απ0

# + α(1-α)π1# + (1-α)2π0 π2

#

π3 = απ0

# + α(1-α)π1# + α(1-α)2π2

# + (1-α)3π0 π2#

熟練者の方策に従う確率を等比級数的に減らしていく

(熟練者の方策に従わない時も、熟練者が選ぶアクションを蓄積し教師データとすることに注意)

以降同様に、イテレーションごとに πn = πn-1 + α(1-α)n-1 (πn# - π0) に従い方策を決定する

最終イテレーション後に、 π0 成分を除去し正規化し、最終的な方策 πN とする

α〜O(1/T2) , N〜O(T2 logT) であれば J(πN) - J(π*) は near-linear になる

※ π の加算は確率的な選択を意味する

Page 21: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

SMILe 擬似コード

21

Page 22: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法4. DAgger

22

Page 23: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

手法4. DAgger (Dataset Aggregation)

● 現在のデータセットで学習した方策 πi# と、熟練者の方策 π* を確率 βi で混合し

た方策を用いてデータ収集し、データセットに加えることを繰り返す

● βi の決め方

‐ βi = I(i=1) が性能が良い(他には βi = pi-1 なども自然)

● イテレーション数N〜O(T2)、各イテレーションの収集データ個数m〜O(1)のとき、J(π*) - J(π#)〜O(T)になる

23

π1 = β1 π

* + (1-β1) π1# π2

#

π1# 初期値としてπ1

# を任意に決める

この方策でデータ収集

π2 = β2 π* + (1-β2) π2

# π3#この方策で

データ収集

π3 = β3 π* + (1-β3) π3

# π4#この方策で

データ収集

Page 24: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

DAgger 擬似コード

24

Page 25: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

実験1. Super Tux Kart

25

Page 26: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

実験1. Super Tux Kart● 入力: 25×19にリサイズされたRGB画像

● 出力: ハンドル向き [-1,1]● モデル: 入力から出力への線形回帰

26

Page 28: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

28

実験1. Super Tux Kart● 1ステージ約1000フレーム(5fpsで操作)

● 人間の熟練者から学ぶ

● 15〜20回ほどでコースアウト

しなくなる

Page 29: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

実験2. Super Mario Bros

29

Page 30: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

実験2. Super Mario Bros● 入力: 22×22のゲーム内座標の14次元バイナリ特徴量

‐ マリオ中心、敵・ブロックetc…‐ 直近4フレームぶん(27152次元)

● 出力: 右・左・A・Bの4次元バイナリベクトル

● モデル: 入力から各出力へ回帰する線形SVM

30

Page 32: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

実験2. Super Mario Bros● 1ステージ約150データ点

● 20回ほどでかなり学習できる

● 性能比較

‐ Se: SMILe同様のSEARNという手法

‐ D0: βi=I(i=1)D0.5: βi=0.5i

32

Page 33: 論文紹介 "A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning"(チームラボ勉強会 2016/10/13)

まとめ

● 模倣学習の色々な手法(主に著者自身のもの)を比較

● 所感

‐ とても単純だし、

強化学習より桁違いに早く学習できるので

何かに使えそうですね

33