1
$\begingroup$

Let's take the LunarLander environment from the package Gym as an example.

enter image description here

In this case, one can run thousand of episodes until the agent learns a good policy. However, there is a condition: the goal region doesn't move anywhere. In every episode it stays exactly at the same place. It is intuitively "easy" to understand that the policy converges after many iterations with the environment.

What happens if the goal region is not in the same position, when a new episode begins?

  • Can the agent learn to generalize by running more and more episodes? (which I do not understand intuitively)
  • Should I change completely policy (PPO, A2C, TD3, SAC, etc) and look for a policy that takes into consideration that the goal region can change?

The reason of my question is that I saw that there are some frozen lake environments where the grid is generated randomly; therefore, the policy can be learned somehow.

$\endgroup$

1 Answer 1

1
$\begingroup$

There is a possibility that the agent can generalize to land in an arbitrary goal region if the goal region is varied at the start of each training episode. If the locations of the goal region and agent are provided in the observation or if the function approximator (e.g. convolutional neural network) is powerful enough to identify these objects, then the agent will be forced to learn that a high reward comes from landing in the goal region and vice versa (it is unable to memorize a single trajectory for a fixed goal region). From my past experience training on this environment, I think the possibility of successful generalization is quite good.

In the seminal work on generalization for deep reinforcement learning (link), there were many experiments performed to understand the effect of algorithmic additions on generalization, as follows:

  • Increasing the number of training levels improved generalization. Surprisingly, agents were shown to overfit to a large number of training levels.
  • Larger neural networks improved generalization at the expense of extra training time.
  • Regularization methods such as L2 regularization, dropout, data augmentation, and batch normalization improved generalization.
  • Adding stochasticity to the environment or the agent's policy produced a greater improvement than any of the regularization methods in the previous bullet point.

To help answer your second question, another work (link) determined that vanilla reinforcement learning algorithms such as A2C and PPO performed better than some other reinforcement learning algorithms specifically constructed to tackle the problem of generalization. I suggest first experimenting with some of the algorithmic additions mentioned above since many are fairly simple to implement. If those do not suffice, then I recommend scanning the literature for novel algorithms that have been developed since those two papers were written (2018) that aim to overcome the problem of generalization.

$\endgroup$
2
  • 1
    $\begingroup$ Sorry but what about reshaping the reward function? Could be a possible solution to the problem? $\endgroup$
    – Dave
    Commented Jun 15 at 12:45
  • 1
    $\begingroup$ @Dave I read a few references and didn't see anything about reward shaping helping generalization. $\endgroup$
    – DeepQZero
    Commented Jun 15 at 21:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .