SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
ディープラーニングの最新動向
強化学習とのコラボ編④ FRMQN	
2016/8/18
株式会社ウェブファーマー
大政 孝充
今回取り上げるのはこれ	
[1]J. Oh, V. Chockalingam, S. Singh, H. Lee. “Control of
Memory, Active Perception, and Action in Minecraft” arXiv:
1605.09128, 2016.
DQNに記憶装置をとりつけることで、Minecraftでの得点で
従来手法を上回った!
通常のDQN部分は・・・	
通常のDQN部分の全体像は塚原裕史氏「論文紹介 Playing Atari with
Deep Reinforcement Learning」[2]
http://www.slideshare.net/htsukahara/paper-intoduction-playing-atari-
with-deep-reinforcement-learning
や藤田康博氏「Playing Atari with Deep Reinforcement Learning」[3]
http://www.slideshare.net/mooopan/ss-30336609
もしくは私の「ディープラーニングの最新動向 強化学習とのコラボ編① 
DQN」[4]
http://www.slideshare.net/ssuser07aa33/introduction-to-deep-q-learning
などを参照してください
解説のポイント	
①記憶装置ってどんなの?
②contextってどうやって求めるの?
③結果どうなった?
解説のポイント	
①記憶装置ってどんなの?
②contextってどうやって求めるの?
③結果どうなった?
記憶装置のしくみ	
記憶装置に書き込む 記憶装置から読み込む
[1]Figure 2
これが記憶装置!
まず書き込む方	
記憶装置に書き込む 記憶装置から読み込む
[1]Figure 2
記憶そのものと記憶のkeyに分かれている    
[1]Figure 2
記憶そのもの
記憶のkey
書き込み① 入力画像をCNNでencoding	
[1]Figure 2
h c
w
入力画像 xt CNNでencoding →
et =ϕ xt( ) e
et
xt ∈ Rc×h×w
et ∈ Re
書き込み② 過去  期間の  から  とする  	
[1]Figure 2
過去   期間の   → 
Et = et−1,et−2,!,et−M[ ]
e
Et
Et ∈ Re×M
etM Et
etM
M
書き込み③   をkeyに変える重み     	
[1]Figure 2
encode  をkeyに変える重み
W key e
Et
W key
∈ Rm×e
W key
m
W key
Et
書き込み④ 記憶のkeyとなる   を作成    
[1]Figure 2
  と   との積から記憶のkeyとなる
   を作成  
M
Et
Mt
key
∈ Rm×M
Mt
key
m
Mt
key
= W key
Et
Mt
key
W key
書き込み⑤    の中身     	
[1]Figure 2
M
2 5 3 ! 4
1 2 1 ! 2
2 6 2 ! 3
4 0 2 ! 1
⎡
⎣
⎢
⎢
⎢
⎢
⎤
⎦
⎥
⎥
⎥
⎥
m
Mt
key
   に対するkeyt − 2
   は例えばこんな感じ  Mt
key
書き込み⑥   を記憶に変える重み     	
[1]Figure 2
encode  を記憶に変える重み
W val e
Et
W val
∈ Rm×e
W val
m
W val
Et
書き込み⑦ 記憶   を作成     	
[1]Figure 2
  と   との積から記憶   を作成
M
Et
Mt
val
∈ Rm×M
Mt
val
m
Mt
val
= W val
Et
Mt
val
W val
書き込み⑧    の中身     	
[1]Figure 2
M
3 4 1 ! 8
7 0 1 ! 2
2 6 4 ! 1
1 2 2 ! 0
⎡
⎣
⎢
⎢
⎢
⎢
⎤
⎦
⎥
⎥
⎥
⎥
m
Mt
val
   に対する記憶t − 2
   は例えばこんな感じ  Mt
val
読み込み① contextを入力     	
context
m
ht
ht ∈ Rm
3
2
7
1
!
4
⎡
⎣
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎤
⎦
⎥
⎥
⎥
⎥
⎥
⎥
⎥
m
   に関する部分t − 2
[1]Figure 2
読み込み② 各  に対する注目重みを計算	
   と      とのsoftmaxで
注目重み   を計算する
m
ht
pt,i ∈ R
t
Mt
key
i[ ]
pt,i
pt,i =
exp ht
Τ
Mt
key
i[ ]⎡⎣ ⎤⎦
exp ht
Τ
Mt
key
j[ ]⎡⎣ ⎤⎦j=1
M
∑
[1]Figure 2
読み込み③   を直感的に理解する	
現在のcontextに反応した
過去の記憶のある時刻部分
が   として着火するイメージ
ht
Τ
pt,i
m
m⊗
[1]Figure 2
Mt
key
i[ ]
t = 2
pt,i
読み込み④   が集まって注目重み  	pt
[1]Figure 2
pt = pt,1, pt,2,!, pt,M
⎡⎣ ⎤⎦
pt,i
全部集めて注目重み  とするpt
pt ∈ RM
読み込み⑤ 記憶を引き出す	
[1]Figure 2
ot = Mt
val
pt
注目重み  を手掛かりに
記憶    を引き出す
pt
pt ∈ Rm
Mt
val
読み込み⑥ 記憶を引き出すイメージ	
[1]Figure 2
大きな注目重み  に対応
する     の  番目が
反応する
pt
Mt
val
i[ ]
pt
m ⊗
Mt
val
M
i
M
このへんの
値が大きいこのへんが
主に引き出
される
最後に出力	
[1]Figure 2
qt =ϕq
ht,ot( )
cntext  と記憶装置からの出
力  を全結合層に入力し、
全体の出力  を出す
ht
qt
ot
ht
qt
qt ∈ Ra
gt = f W h
ht +ot( )
qt = W q
gt
解説のポイント	
①記憶装置ってどんなの?
②contextってどうやって求めるの?
③結果どうなった?
contextを求める3つの仕組み	
context  を求める仕組みを3種類考えた
1)MQN
2)RMQN
3)FRMQN
ht
contextを求める3つの仕組み	
まずこれから
1)MQN
2)RMQN
3)FRMQN
MQNでのcontext	
[1]Figure 2
ht
CNNの出力  に重み   
をかけてcontext  とする
ht = W c
et
W cet
et
ht
htW c
W c
∈ Rm×e
contextを求める3つの仕組み	
次はこれ
1)MQN
2)RMQN
3)FRMQN
RMQNでのcontext	
[1]Figure 2
ht
CNNの出力  とメモリセル
の出力   、recurrentの    
をLSTMに入力する
ht,ct[ ]= LSTM et,ht−1,ct−1( )
et
et
ht−1
ht
RはrecurrentのR →LSTMを使う
LSTMht−1,ct−1
ct−1 :メモリセルの出力
→peephole
ct−1
ct−1 ∈ Rm
contextを求める3つの仕組み	
最後はこれ
1)MQN
2)RMQN
3)FRMQN
FRMQNでのcontext	
LSTMの入力に記憶装置から
の出力   を加える
ht,ct[ ]= LSTM et,ot−1[ ],ht−1,ct−1( )
et
ot−1
ht
LSTMの入力に   を加える
LSTMht−1,ct−1
ot−1
ot
ot−1
[1]Figure 2
  回帰する   の部分のイメージ	
[1]Figure 2
前回、記憶装置から引き出され
た記憶をcontextに加える
et
ht
LSTMht−1,ct−1
ot
ot−1
ot−1
「これこれこういった記憶が引き
出されたなら、次はこういった記
憶が引き出されるべき」みたい
なものを学習させることができ
る?
  全種類まとめ	
[1]Figure 3
解説のポイント	
①記憶装置ってどんなの?
②contextってどうやって求めるの?
③結果どうなった?
3種類の実験とその結果	
① I 字型迷路
②パターンマッチング
③ランダムな迷路
3種類の実験とその結果	
① I 字型迷路
②パターンマッチング
③ランダムな迷路
I 字型迷路の概要	
上部中央からスタート。
左右に黄色、もしくは緑
のindicatorがある。エー
ジェントはこれを記憶す
る。
ゴールは下方にある。経
過時間に応じてマイナス
の報酬を与えられるので、
エージェントは早く下方
に行くようになる。
indicatorが黄色の場合、
赤に到着すればプラス
の報酬、青に到着すれ
ばマイナスの報酬となる。
エージェント
の視点
[1]Figure 10
I 字型迷路の結果①	
l  新手法はDQNやDRQNより早く収
束している。特にFRMQNが早い。
l  DRQNは早く下方に到達するよう
になった後、左右いずれを選択す
るかを学習するのに時間がかかる。
l  一方、新手法は左右の選択を早く
学習できる
[1]Figure 3,6
indicatorの情報を思い出すのは下方
到達時だけでいい。DRQNは長い廊
下を下る間、indicatorの情報を保持す
るのが難しい。一方で新手法は下方
に到達したというcontextによって
indicatorの記憶を引き出せるので、有
利。
得点の平均値
学習回数
I 字型迷路の結果②	
[1]Figure 7a
下方の分かれ目に来
た時に、indicatorの記
憶を呼び起こしてい
る!
ここでindicatorの色を
記憶。
FRMQNの注目重みを可視化したもの
3種類の実験とその結果	
① I 字型迷路
②パターンマッチング
③ランダムな迷路
パターンマッチングの概要	
上部中央からスタート。左
右に同じパターンか、もし
くは違うパターンの部屋
がある。この場合は違う
パターン。これを記憶する。
[1]Figure 12
エージェント
の視点
ゴールは下方。時間とと
もにマイナスの報酬を受
け取るので、早く下方へ
移動するようになる。
違うパターンの場合、青
に到達するとプラスの報
酬、赤はマイナスの報酬。
同じパターンの場合は逆。
パターンマッチングの結果	
l  新手法はDQNやDRQNより高い
値に収束した
l  DRQNは下方のゴールいずれか
には達するようになるが、正しい
方を選択する事を学習できない
[1]Figure 3,6
l  DRQNは異なる時間で観察した画
像をマッチングさせるのが難しい?
l  FRMQNはいずれの記憶もcontext
にそって呼び起こし、マッチングさ
せされるのでいい結果につながっ
ているか?
得点の平均値
学習回数
3種類の実験とその結果	
① I 字型迷路
②パターンマッチング
③ランダムな迷路
ランダムな迷路の概要	
[1]Figure 19
エージェント
の視点
I 字型迷路と同様に、は
じめに黄色もしくは緑の
indicatorを見て記憶する。
緑の場合は青がゴール、
黄色の場合は赤がゴー
ル。時間とともにマイナ
スの報酬が与えられる
のでゴールへ急ぐ。
青のゴールに到達すれば
プラスの報酬、赤に到達す
ればマイナスの報酬が与え
られる。これにより青へ到
達することを学習する。
ランダムな迷路の結果① training data	
training dataでの収束状況
[1]Figure 3,6
得点の平均値
学習回数
FRMQNやRMQNが得点が高いが、
DRQNもそこそこ高い
ランダムな迷路の結果② unseen map	
training dataにはないテスト用
の迷路で汎化性能を確認
[1]Figure 3,6
得点の平均値
学習回数
汎化性能はFRMQNやRMQNが高い
結  論	
このようなMincraftの迷路では、新手法は高い
得点をあげる
特にFRMQNがいい!
終わり

Weitere ähnliche Inhalte

Mehr von WEBFARMER. ltd.

論文読み会 発表資料 SPMモデル
論文読み会 発表資料 SPMモデル論文読み会 発表資料 SPMモデル
論文読み会 発表資料 SPMモデルWEBFARMER. ltd.
 
The 53th Computer Vision Study@ kantou by Takamitsu Omasa
The 53th Computer Vision Study@ kantou by Takamitsu OmasaThe 53th Computer Vision Study@ kantou by Takamitsu Omasa
The 53th Computer Vision Study@ kantou by Takamitsu OmasaWEBFARMER. ltd.
 
SPIGAN理論と実装について at 論文LT会 in LPIXEL
SPIGAN理論と実装について at 論文LT会 in LPIXELSPIGAN理論と実装について at 論文LT会 in LPIXEL
SPIGAN理論と実装について at 論文LT会 in LPIXELWEBFARMER. ltd.
 
Nips2018 study only_pu_net_pdf
Nips2018 study only_pu_net_pdfNips2018 study only_pu_net_pdf
Nips2018 study only_pu_net_pdfWEBFARMER. ltd.
 
第46回コンピュータ・ビジョン勉強会@関東(前編)
第46回コンピュータ・ビジョン勉強会@関東(前編)第46回コンピュータ・ビジョン勉強会@関東(前編)
第46回コンピュータ・ビジョン勉強会@関東(前編)WEBFARMER. ltd.
 
Chainer Meetup 発表資料
Chainer Meetup 発表資料Chainer Meetup 発表資料
Chainer Meetup 発表資料WEBFARMER. ltd.
 
Study Group of NIPS2017 presented by webfarmer.ltd
Study Group of NIPS2017 presented by webfarmer.ltdStudy Group of NIPS2017 presented by webfarmer.ltd
Study Group of NIPS2017 presented by webfarmer.ltdWEBFARMER. ltd.
 
Machine Learning 15minutes 発表資料(株)ウェブファーマー
Machine Learning 15minutes 発表資料(株)ウェブファーマーMachine Learning 15minutes 発表資料(株)ウェブファーマー
Machine Learning 15minutes 発表資料(株)ウェブファーマーWEBFARMER. ltd.
 
Ml15min発表資料(提出用)
Ml15min発表資料(提出用)Ml15min発表資料(提出用)
Ml15min発表資料(提出用)WEBFARMER. ltd.
 
Introduction to GAN model
Introduction to GAN modelIntroduction to GAN model
Introduction to GAN modelWEBFARMER. ltd.
 
Introduction to A3C model
Introduction to A3C modelIntroduction to A3C model
Introduction to A3C modelWEBFARMER. ltd.
 
Introduction to YOLO detection model
Introduction to YOLO detection modelIntroduction to YOLO detection model
Introduction to YOLO detection modelWEBFARMER. ltd.
 
Introduction to Deep Compression
Introduction to Deep CompressionIntroduction to Deep Compression
Introduction to Deep CompressionWEBFARMER. ltd.
 
ディープラーニング・ハンズオン勉強会161229
ディープラーニング・ハンズオン勉強会161229ディープラーニング・ハンズオン勉強会161229
ディープラーニング・ハンズオン勉強会161229WEBFARMER. ltd.
 
人工知能ハッカソン用プレゼン資料(161217)
人工知能ハッカソン用プレゼン資料(161217)人工知能ハッカソン用プレゼン資料(161217)
人工知能ハッカソン用プレゼン資料(161217)WEBFARMER. ltd.
 
Hackathon 161010 pressen
Hackathon 161010 pressenHackathon 161010 pressen
Hackathon 161010 pressenWEBFARMER. ltd.
 
introduce to Multimodal Deep Learning for Robust RGB-D Object Recognition
introduce to Multimodal Deep Learning for Robust RGB-D Object Recognitionintroduce to Multimodal Deep Learning for Robust RGB-D Object Recognition
introduce to Multimodal Deep Learning for Robust RGB-D Object RecognitionWEBFARMER. ltd.
 

Mehr von WEBFARMER. ltd. (20)

論文読み会 発表資料 SPMモデル
論文読み会 発表資料 SPMモデル論文読み会 発表資料 SPMモデル
論文読み会 発表資料 SPMモデル
 
The 53th Computer Vision Study@ kantou by Takamitsu Omasa
The 53th Computer Vision Study@ kantou by Takamitsu OmasaThe 53th Computer Vision Study@ kantou by Takamitsu Omasa
The 53th Computer Vision Study@ kantou by Takamitsu Omasa
 
SPIGAN理論と実装について at 論文LT会 in LPIXEL
SPIGAN理論と実装について at 論文LT会 in LPIXELSPIGAN理論と実装について at 論文LT会 in LPIXEL
SPIGAN理論と実装について at 論文LT会 in LPIXEL
 
Nips2018 study only_pu_net_pdf
Nips2018 study only_pu_net_pdfNips2018 study only_pu_net_pdf
Nips2018 study only_pu_net_pdf
 
第46回コンピュータ・ビジョン勉強会@関東(前編)
第46回コンピュータ・ビジョン勉強会@関東(前編)第46回コンピュータ・ビジョン勉強会@関東(前編)
第46回コンピュータ・ビジョン勉強会@関東(前編)
 
Chainer Meetup 発表資料
Chainer Meetup 発表資料Chainer Meetup 発表資料
Chainer Meetup 発表資料
 
SLAM_study_document
SLAM_study_documentSLAM_study_document
SLAM_study_document
 
Study Group of NIPS2017 presented by webfarmer.ltd
Study Group of NIPS2017 presented by webfarmer.ltdStudy Group of NIPS2017 presented by webfarmer.ltd
Study Group of NIPS2017 presented by webfarmer.ltd
 
Nips20180127
Nips20180127Nips20180127
Nips20180127
 
Machine Learning 15minutes 発表資料(株)ウェブファーマー
Machine Learning 15minutes 発表資料(株)ウェブファーマーMachine Learning 15minutes 発表資料(株)ウェブファーマー
Machine Learning 15minutes 発表資料(株)ウェブファーマー
 
DRL_stydy_1_doc_ohmasa
DRL_stydy_1_doc_ohmasaDRL_stydy_1_doc_ohmasa
DRL_stydy_1_doc_ohmasa
 
Ml15min発表資料(提出用)
Ml15min発表資料(提出用)Ml15min発表資料(提出用)
Ml15min発表資料(提出用)
 
Introduction to GAN model
Introduction to GAN modelIntroduction to GAN model
Introduction to GAN model
 
Introduction to A3C model
Introduction to A3C modelIntroduction to A3C model
Introduction to A3C model
 
Introduction to YOLO detection model
Introduction to YOLO detection modelIntroduction to YOLO detection model
Introduction to YOLO detection model
 
Introduction to Deep Compression
Introduction to Deep CompressionIntroduction to Deep Compression
Introduction to Deep Compression
 
ディープラーニング・ハンズオン勉強会161229
ディープラーニング・ハンズオン勉強会161229ディープラーニング・ハンズオン勉強会161229
ディープラーニング・ハンズオン勉強会161229
 
人工知能ハッカソン用プレゼン資料(161217)
人工知能ハッカソン用プレゼン資料(161217)人工知能ハッカソン用プレゼン資料(161217)
人工知能ハッカソン用プレゼン資料(161217)
 
Hackathon 161010 pressen
Hackathon 161010 pressenHackathon 161010 pressen
Hackathon 161010 pressen
 
introduce to Multimodal Deep Learning for Robust RGB-D Object Recognition
introduce to Multimodal Deep Learning for Robust RGB-D Object Recognitionintroduce to Multimodal Deep Learning for Robust RGB-D Object Recognition
introduce to Multimodal Deep Learning for Robust RGB-D Object Recognition
 

The introduction to FRMQN model