官术网_书友最值得收藏!

Deriving the Bellman equation for value and Q functions

Now let us see how to derive Bellman equations for value and Q functions.

You can skip this section if you are not interested in mathematics; however, the math will be super intriguing.

First, we define,  as a transition probability of moving from state  to  while performing an action a:

We define  as a reward probability received by moving from state  to  while performing an action a:

             from (2)    ---(5)

We know that the value function can be represented as:

 from (1)

We can rewrite our value function by taking the first reward out:

  ---(6)

The expectations in the value function specifies the expected return if we are in the state s, performing an action a with policy π.

So, we can rewrite our expectation explicitly by summing up all possible actions and rewards as follows:

In the RHS, we will substitute  from equation (5) as follows:

Similarly, in the LHS, we will substitute the value of rt+1 from equation (2) as follows:

So, our final expectation equation becomes:

  ---(7)

Now we will substitute our expectation (7) in value function (6) as follows:

Instead of , we can substitute  with equation (6), and our final value function looks like the following:

In very similar fashion, we can derive a Bellman equation for the Q function; the final equation is as follows:

Now that we have a Bellman equation for both the value and Q function, we will see how to find the optimal policies.

主站蜘蛛池模板: 海门市| 胶州市| 萝北县| 赣榆县| 云阳县| 宜丰县| 抚远县| 江川县| 丰县| 双江| 新绛县| 石棉县| 凌海市| 黄石市| 麟游县| 宜丰县| 贵港市| 丰镇市| 西华县| 甘洛县| 永寿县| 曲松县| 乡宁县| 鄂伦春自治旗| 屏山县| 启东市| 巴林左旗| 武平县| 常熟市| 东辽县| 司法| 武安市| 甘肃省| 安宁市| 元阳县| 上饶县| 同江市| 漾濞| 宜州市| 姜堰市| 山丹县|