<p>What you describe is actually one of the most important research areas of Deep RL: the exploration problem.</p>
<p>The PPO algorithm (like many other &quot;standard&quot; RL algos) tries to maximise a return, which is a (usually discounted) sum of rewards provided by your environment:</p>
<p><a href="https://i.stack.imgur.com/FBG9L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBG9L.png" alt="enter image description here" /></a></p>
<p>In your case, you have a <strong>deceptive gradient</strong> problem, the gradient of your return points directly at your objective point (because your reward is the distance to your objective), which discourage your agent to explore other areas.</p>
<p>Here is an illustration of the deceptive gradient problem from <a href="https://arxiv.org/pdf/2006.08505.pdf" rel="nofollow noreferrer">this paper</a>, the reward is computed like yours and as you can see, the gradient of your return function points directly to your objective (the little square in this example). If your agent starts in the bottom right part of the maze, you are very likely to be stuck in a local optimum.</p>
<p><a href="https://i.stack.imgur.com/Tbxdg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tbxdg.png" alt="enter image description here" /></a></p>
<p>There are many ways to deal with the exploration problem in RL, in PPO for example you can add some noise to your actions, some other approachs like <a href="https://arxiv.org/pdf/1812.05905.pdf" rel="nofollow noreferrer">SAC</a> try to maximize both the reward and the entropy of your policy over the action space, but in the end you have no guarantee that adding exploration noise in your <strong>action space</strong> will result in efficient of your <strong>state space</strong> (which is actually what you want to explore, the (x,y) positions of your env).</p>
<p>I recommend you to read the <strong>Quality Diversity</strong> (QD) literature, which is a very promising field aiming to solve the exploration problem in RL.</p>
<p>Here is are two great resources:</p>
<ul>
<li><a href="https://quality-diversity.github.io/" rel="nofollow noreferrer">A website gathering all informations about QD</a></li>
<li><a href="https://www.youtube.com/watch?v=g6HiuEnbwJE" rel="nofollow noreferrer">A talk from    ICLM 2019</a></li>
</ul>
<p>Finally I want to add that the problem is not your reward function, you should not try to engineer a complex reward function such that your agent is able to behave like you want. The goal is to have an agent that is able to solve your environment despite pitfalls like the deceptive gradient problem.</p>
Reinforcement learning. Driving around objects with PPO
<p>I am working on driving industrial robots with neural nets and so far it is working well. I am using the PPO algorithm from the OpenAI baseline and so far I can drive easily from point to point by using the following rewarding strategy:</p>
<p>I calculate the normalized distance between the target and the position. Then I calculate the distance reward with.</p>
<pre><code>rd = 1-(d/dmax)^a
</code></pre>
<p>For each time step, I give the agent a penalty calculated by.</p>
<pre><code>yt = 1-(t/tmax)*b
</code></pre>
<p>a and b are hyperparameters to tune.</p>
<p>As I said this works really well if I want to drive from point to point. <strong>But what if I want to drive around something?</strong> For my work, I need to avoid collisions and therefore the agent needs to drive around objects. If the object is not straight in the way of the nearest path it is working ok. Then the robot can adapt and drives around it. But it gets more and more difficult to impossible to drive around objects which are straight in the way.</p>
<p>See this image :
<a href="https://i.stack.imgur.com/5liV2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5liV2.png" alt="enter image description here" /></a></p>
<p>I already read a <a href="https://arxiv.org/abs/1905.09492?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A%20arxiv%2FQSXk%20%28ExcitingAds%21%20cs%20updates%20on%20arXiv.org%29" rel="nofollow noreferrer">paper</a> which combines PPO with NES to create some Gaussian noise for the parameters of the neural network but I can't implement it by myself.</p>
<p>Does anyone have some experience with adding more exploration to the PPO algorithm? Or does anyone have some general ideas on how I can improve my rewarding strategy?</p>