Considering application of Reinforcement learning(dynamic programming method performing value iteration) on grid world, in each of the iteration, I go through each of the cell of the grid and update its value depending on its present value and the present value of the taking action from that state. Now

  1. How long do I keep updating value of each cell? Shall I keep updating unless the change in the previous and the present value function is the least? I am not able to understand how to implement the stopping mechanism in the grid-world scenario(discount not considered)

  2. Is the value function the values of all the grids in the grid world?

1 Answer 1


1- You should set a threshold (a hyper-param) that will allow you to quit the loop.

Let V the values for all state s and V' the new values after value iteration.

if $\sum_s|V(s) - V’(s)| \le threshold$, quit

2 - V is a function for every cell in the grid yes because you need to update every cell.

Hope it helps.

  • $\begingroup$ how do I set a threshold... What i am doing id the update the value of each grid with respect to the grids that the control can go to from the present grid.. What do you mean by saying V is a function $\endgroup$
    – girl101
    Aug 6, 2015 at 4:00
  • $\begingroup$ $V(s)$ is a function that returns the utility of that state. In a computer program, where you have enumerated the states, you may well end up modelling $V$ as a simple array and treat it as an array lookup $\endgroup$ Aug 6, 2015 at 8:53
  • $\begingroup$ how do I set the threshold $\endgroup$
    – girl101
    Aug 10, 2015 at 5:08
  • $\begingroup$ Make some test to what is best for you. Typically 0 is the optimal solution. That means that there is no better solution than this one. Since it's an hyperparam, you can learn it via a neural network. $\endgroup$
    – Dref360
    Aug 10, 2015 at 20:55
  • $\begingroup$ @Dref360 i want to learn it via dynamic programming , I dont want to learn it via neural, $\endgroup$
    – girl101
    Aug 11, 2015 at 3:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.