[Chapter 3] Reinforcement Learning (1) Model-Based Method

Reinforcement Learning

Firstly, we assume that all the environments in the following materials are all modeled by Markov decision processes. As we have known, an MDP model can be represented by a tuple (S,A,T,R), the rewards are returned from the environment after each step, or sometimes they are returned only at the end of the game. No matter how frequent we can get a reward from environment, they can help the agent to learn a better policy, so the reward is also called reinforcement here. So, reinforcement learning aims to use observed rewards to learn an optimal (or nearly optimal) policy that maximizes expected total reward for the environment.

In most situations, we assume no knowledge of the model for the environment (transition function) or the reward function.

Prediction and Control

Usually, in learning problems, we are not given the model and have to use observed data. There are two main parts for a learning problem:

  • Prediction problem: for a fixed policy {\pi}, to learn the value V or action-value Q from the observed data by executing the policy. In this part, we want to learn to model the environment, namely, learn how the environment works.
  • Control problem: to learn the policy {\pi}. In this part, we want to find an optimal policy based on our observed data and our current knowledge of the environment.

The two parts suport each other, one learns the environment and another one learns the policy.

image

Exploration and Exploitation

The two parts of the learning problem can also be understood in another aspect. Since mostly, we don't know clearly about the environment (the transition model and the reward function), so one important thing is to learn about the environment, namely, explore the environment; once we have some knowledge about how it works, we will try to exploit what we have learnt. How to trade the exploration and exploitation off is a very important thing.

A very classic example is the multi-armed bandit. To make things simple, we suppose there are only two arms on the bandit, with differnet and unknown probability of how likely you can get a reward at one play. To illustrate the problem, we now set the probability of the two arms as the following table, note that we actually don't know these probabilities, just like we don't know about an environment.

Arm Probability of Getting 10-Dollar Reward
Arm 1 0.3
Arm 2 0.8

Now, suppose you have 1000 chances to choose pull one of the arm and you want to get a highest cumulative reward, what should you do?

  • Exploration: for some chances, you randomly choose one of the arm and record the times you get the reward, then based on the experiences, you will more precisely approximate the behind probability of each arm, just like the sampling experiment.

  • Exploitation: for some chances, based on your estimated probability, you will always choose the arm with higher proability of getting reward.

However, you may feel hesitant, if you use more chances to explore, you get a more precise estimation, but there will be less chances left for you to exploit your higher-probability arm; if you use few chances to explore, you indeed have more chances to explit your knowledge, but you may not get an accurate estimation, so you may always choose the arm with lower probability. This is the exploration vs exploitation dilemma.

In reinforcement learning, actions interacting with the environment not only gain reward but also help to learn a better model, by improving the model, greater reward may potentially be obtained. A scheme called greedy in the limit of infinite exploration (GLIE) for balancing exploration and exploitation must:

  • Try each action in each state an unbounded number of times to avoid a finite probability of missing an optimal action
  • Eventually become greedy so that it is optimal with respect to the true model

One simple GLIE scheme is to do \epsilon-greedy exploration with choice of \epsilon=\frac{1}{t}, \epsilon-greedy exploration means that choose the greedy action (explotiation) with probability 1-\epsilon and a random action (exploration) with probability \epsilon. And here, we set the \epsilon to graudally decrease with time, then it becomes one of the GLIE scheme.

Model-Based RL Method

In model-based prediction, we try to learn the model and solve it. This method needs the agent firstly model the environment, namely, to learn the transition model P(s^′|s,a) and reward function R(s,a,s^′), so it can calculate the values by doing policy evaluation stated in the earlier chapters (solve linear equations or use iterative method).

Learning the transition model and the reward function can be done easily using sampling. For example, we did N times of experiments, we notice that there are M times for the environment transit from state s_a to s_b after taking action a and get reward r in average, then we can approximately set the transition function P(s_b│s_a,a)=\frac{M}{N} and the reward function R(s_a,a,s_b)=r. The more experiments we do, the more accurate we can model the environment.

Once we have modeled the environment, then the agent can learn an optimal policy using basic Adaptive Dynamic Programming (ADP) method. Evenly, if the environment is deterministic (all transition probability equals to 1), then simply using greedy algorithm by choosing the action leading to the highest value can be the optimal policy.

Finally, model-based method is based on modeling the environment and solving the model. (Evenly, for some situations that we know the model in advance, it becomes much more easier). Conversely, a model-free method considers learning the value function directly without learning the transition and reward functions, namely, it doesn't model the environment any more.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末宙帝,一起剝皮案震驚了整個(gè)濱河市吮铭,隨后出現(xiàn)的幾起案子鲤拿,更是在濱河造成了極大的恐慌偿枕,老刑警劉巖折欠,帶你破解...
    沈念sama閱讀 221,198評(píng)論 6 514
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過(guò)查閱死者的電腦和手機(jī)茶宵,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,334評(píng)論 3 398
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)宗挥,“玉大人乌庶,你說(shuō)我怎么就攤上這事∑豕ⅲ” “怎么了瞒大?”我有些...
    開封第一講書人閱讀 167,643評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)宵喂。 經(jīng)常有香客問(wèn)我,道長(zhǎng)会傲,這世上最難降的妖魔是什么锅棕? 我笑而不...
    開封第一講書人閱讀 59,495評(píng)論 1 296
  • 正文 為了忘掉前任,我火速辦了婚禮淌山,結(jié)果婚禮上裸燎,老公的妹妹穿的比我還像新娘。我一直安慰自己泼疑,他們只是感情好德绿,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,502評(píng)論 6 397
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般移稳。 火紅的嫁衣襯著肌膚如雪蕴纳。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,156評(píng)論 1 308
  • 那天个粱,我揣著相機(jī)與錄音古毛,去河邊找鬼。 笑死都许,一個(gè)胖子當(dāng)著我的面吹牛稻薇,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播胶征,決...
    沈念sama閱讀 40,743評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼塞椎,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了睛低?” 一聲冷哼從身側(cè)響起案狠,我...
    開封第一講書人閱讀 39,659評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎暇昂,沒想到半個(gè)月后莺戒,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,200評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡急波,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,282評(píng)論 3 340
  • 正文 我和宋清朗相戀三年从铲,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片澄暮。...
    茶點(diǎn)故事閱讀 40,424評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡名段,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出泣懊,到底是詐尸還是另有隱情伸辟,我是刑警寧澤,帶...
    沈念sama閱讀 36,107評(píng)論 5 349
  • 正文 年R本政府宣布馍刮,位于F島的核電站信夫,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏卡啰。R本人自食惡果不足惜静稻,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,789評(píng)論 3 333
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望匈辱。 院中可真熱鬧振湾,春花似錦、人聲如沸亡脸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,264評(píng)論 0 23
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至大州,卻和暖如春续语,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背摧茴。 一陣腳步聲響...
    開封第一講書人閱讀 33,390評(píng)論 1 271
  • 我被黑心中介騙來(lái)泰國(guó)打工绵载, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人苛白。 一個(gè)月前我還...
    沈念sama閱讀 48,798評(píng)論 3 376
  • 正文 我出身青樓娃豹,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親购裙。 傳聞我的和親對(duì)象是個(gè)殘疾皇子懂版,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,435評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容