Keras Reinforcement Learning Projects
by Giuseppe Ciaburro, Sudharsan Ravichandiran, Suriyadeepan Ramamoorthy
Memoization
We have seen that DP is a technique for solving recursive problems more efficiently. Why is this the case? Oftentimes in recursive procedures, we solve subproblems repeatedly. In DP, this does not happen: we memorize the solution of these subproblems so that we do not have to solve them again. This is called memoization.
If the value of a variable at a given step depends on the results of previous calculations, and if the same calculations are repeated over and over, then it is convenient to store the intermediate results so as to avoid repeating computationally expensive calculations.
To better understand the difference between recursion and memoization, let's analyze a simple example: the calculation of the factorial of a number. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access