There's more...

In many RL problems, exploring the actions to formulate an optimal policy can be costly. Experience replay is a technique that's used to make the agents reuse past experiences. This technique enables fast convergence by replaying already observed state transitions as new observations in the environment. Experience replay requires sample sequences comprised of states, actions, and rewards as input data. These transitions make the agent learn a state-action function and an optimal policy for all the states in the input data. This policy can also be applied for validation purposes or to improve the current policy iteratively. To implement experience replay in R, you need to pass an existing RL model as an argument to the ReinforcementLearning() ...

Get Deep Learning with R Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.