Skip to content

Commit

Permalink
Keep parameter space noise consistent with action space noise (Fix 51…
Browse files Browse the repository at this point in the history
…73) (#5193)

*  make parameter space noise consistent with action space noise

*  modified according to lint check

*  indent
  • Loading branch information
joneswong authored and ericl committed Jul 14, 2019
1 parent 322b516 commit 5b13a7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/ray/rllib/agents/ddpg/ddpg_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def postprocess_trajectory(self,
distance_in_action_space = np.sqrt(
np.mean(np.square(clean_actions - noisy_actions)))
self.pi_distance = distance_in_action_space
if distance_in_action_space < self.config["exploration_ou_sigma"]:
if distance_in_action_space < \
self.config["exploration_ou_sigma"] * self.cur_noise_scale:
# multiplying the sampled OU noise by noise scale is
# equivalent to multiplying the sigma of OU by noise scale
self.parameter_noise_sigma_val *= 1.01
else:
self.parameter_noise_sigma_val /= 1.01
Expand Down

0 comments on commit 5b13a7e

Please sign in to comment.