Skip to content

Commit

Permalink
[ci skip] added noise to the DDPG example in HER
Browse files Browse the repository at this point in the history
  • Loading branch information
hill-a committed Sep 17, 2018
1 parent c77cb85 commit 34e00d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/modules/her.rst
Expand Up @@ -28,11 +28,14 @@ Train a HER agent on `MountainCarContinuous-v0`.
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines.her.reward_class import ProximalReward
from stable_baselines.her.utils import stack_obs_goal
from stable_baselines.ddpg.noise import AdaptiveParamNoiseSpec
from stable_baselines import DDPG, HER
env = DummyVecEnv([lambda: gym.make('MountainCarContinuous-v0')]) # The algorithms require a vectorized environment to run
model = HER(DDPG, 'MlpPolicy', env, ProximalReward(eps=0.1)) # define the reward function for HER
param_noise = AdaptiveParamNoiseSpec(initial_stddev=float(0.2), desired_action_stddev=float(0.2))
model = HER(DDPG, 'MlpPolicy', env, ProximalReward(eps=0.1), param_noise=param_noise) # define the reward function for HER
model.learn(total_timesteps=25000)
model.save("her_dqn_mountaincar")
Expand Down

0 comments on commit 34e00d2

Please sign in to comment.