reset password
Author Message
rabbott
Posts: 1649
Posted 14:49 Oct 08, 2018 |

Today in class we talked about how iteration replaces recursion when evaluating the Bellman equation. We went through an impromptu example of factorial.

A Factorial class that illustrates this effect has been added to studentGridWorld. When you run valueIteration on it, it computes the factorial of the first n integers. (The value n is passed as an argument. Note that discount must be set to 0.) For example:

ValueIterationAgent(Factorial(7), discount=0, maxIterations=250, valueType='value')
"""
With argument 7, after 7 iterations, converged to:
 0!       1!       2!       3!       4!      5!         6!        7!
1.00     1.00     2.00     6.00    24.00   120.00     720.00   5,040.00 
"""
Last edited by rabbott at 14:59 Oct 08, 2018.