ラベル

AI Forecast 8306MUFG (211) Social (75) life (70) Financial (62) IT (57) Proposal (56) idea (50) Fund Management (48) Trading (43) economics (42) Covid-19 (40) AI (38) Hedge Fund (36) Risk (36) Culture (31) BOJ (29) Science (26) hobby (24) accounting (17) Apps (16) career (11) job (7) Travel (5) emotion (5) Hiking (4) music (3) Statarb (2) piano (2)

2019年11月17日日曜日

強化学習も関数補間 Reinforcement Learning is also Function Interpolation

強化学習も関数補間

 Reinforcement Learning is also Function Interpolation




AIの「教師あり学習」と「強化学習」とは異なる方法と感じる人も多いだろう。強化学習の代表選手であるQ学習は、関数の補間機能である「教師あり学習」と比べ、どこが違うのだろうか。Many may feel that supervised learning and reinforcement learning are different. What is the difference between Q learning representing reinforcement learning and supervised learning that interpolate functions?

実は、Q学習も「教師あり学習」も、全空間を記述する関数、即ち補間関数を作り上げようとしている点で、本質的な違いはない。In reality, there is no fundamental difference between the Q learning and supervised learning since both try to establish interpolating function describing whole problem universe.

Q学習においては、環境に対し、エージェントが行動Aをとり、報酬rを得た場合、状態Sと行動Aの組合せにおける価値Qを、Qテーブルという表に保存する。テーブルというデータ構造上、全空間は離散化されているが、DQN(Deep Q Neural Network)を使えば離散化は不要となる。なお、Q関数は一般的にはN次元だが、上の図は見易くするため、2次元で書いてある。In Q learning, value Q at state S and action A is stored in table called Q table when agent took action A against environment. Whole problem universe is discritized due to table in nature while such discritization will be unnecessary if DQN(Deep Q neural Network) is used. Q is N dimensional in general however for ease of presentation, it is shown as 2 dimensional.

次のサイクルの行動Aは、現在の状態Sの場合のQを最大にするAとする。探索の幅を広げるために、Aの選択は時々ランダムを入れる。次の行動Aを環境に入れ、次のサイクルが始まる。The action A for next cycle is set by picking the A that makes Q maximum when state is S. For diversity expansion, take A randomly once in a while. The next cycle will start by applying action A to environment.

\begin{align} Q(S_{t},A_{t})  &\gets Q(S_{t},A_{t}) + \alpha(r_{t} + \gamma Max_{A}[Q(S_{t+1},A)] - Q(S_{t},A_{t}) )  \\
&\gets (1-\alpha)Q(S_{t},A_{t}) +\alpha(r_{t} + \gamma Max_{A}[Q(S_{t+1},A)] ) \\  \\

S_{t}  &:  時刻tにおける状態 \ State \ at \ time \ t \\
A_{t} &:  時刻tにおける行動 \ Action \ taken \ at \ time \ t \\
Q(S_{t},A_{t})   &:  S_{t}、A_{t}の場合の価値 \ Value \ at \  S_{t},  \ A_{t} \\
\alpha &:  学習率 \ learning \ rate\\
r_{t}   &:  報酬 \ reward\\
\gamma   &: 割引率 \ discount \ factor\\
Max_{A}[Q(S_{t+1},A)] )   &: A変化時のQの最大値 \ Max \ Q \ by \ varying \ A  \\
\end{align}

「教師あり学習」では最初から大量の教育データがあったが、強化学習では、最初の状態からいろいろ試行を重ねるたびに教育データを集積していくところが異なる。しかし、解の全空間を対象にした補間関数を求めているという点では全く一致している。Supervised training has big data for education but reinforcement learning accumulates data as making try & error.  However, both are identical from the point of seeking for interpolation function covering whole problem universe in scope.

 このため、過去のデータなどから教育データを生成できる場合は、強化学習より「教師あり学習」が効率が良い。一方、二足歩行、ゲームなど、最初の状態が明確で、そこから分岐していくデータのみに意味がある場合など、範囲を絞り込むなんからの境界条件がある場合は強化学習が適している。Hence, if historical data is well prepared, it is more efficient to use supervised learning. Meanwhile, if initial condition is clear followed by consequential status where bounds are rather limited with boundary condition, reinforcement learning may fit.

 この学習の過程を考えていると、人間の学習とダブって見える。最初の教え方がまずいと、紆余曲折、遠回りをして目的を達成することになるが、その過程で、普通なら体験しない様々な場面に遭遇し人生を豊にする。This reinforcement learning process overlaps the process of learning done by human being. If initial instruction is not correctly provided, we end up going around, making detour to achieve objective however, during such elongated process, we may face many interesting situations that other will not encounter, then life will be more fascinating.

 人生の選択は組合せの爆発で、全てのケースを「教師あり学習」することは不可能だ。自然、強化学習となり、そこでは少ないサンプルの試行錯誤の経験値を元に最適化を図っていくことになる。しかし過学習の果て、状態が少しでもずれると利用できなくなったり、逆にデータの少なさにより学習が収束しなかったりなど、少ないサンプルでの収束には問題も多い。これは人間にも言えることで、修練を重ねることで強くなっていく。The choice in life is an explosion of combination, hence it is impossible to have supervised learning for the whole problem universe. Naturally learning will be reinforcement learning where optimization is based on try and error. However over learning destroy robustness while data scarcity makes non convergence.  This applies to human life also however it is mitigated by multiple training.

 この強化学習の考え方は生命の学習と近いものがある。環境が与えたある範囲の最適関数をいち早く正しく習得した個体が生き残る。This reinforcement learning idea is similar to learning by living creatures. Only those that learn the optimized function given by environment correctly and quickly should survive.