Skip to content

Commit

Permalink
Fixed MpiAdam synchronization issue in PPO1 caused by not summing tim…
Browse files Browse the repository at this point in the history
…esteps across all workers. (#52)
  • Loading branch information
brendenpetersen authored and araffin committed Oct 7, 2018
1 parent dafd3d8 commit 2b67e6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stable_baselines/ppo1/pposgd_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def learn(self, total_timesteps, callback=None, seed=None, log_interval=100, tb_
logger.record_tabular("EpRewMean", np.mean(rewbuffer))
logger.record_tabular("EpThisIter", len(lens))
episodes_so_far += len(lens)
timesteps_so_far += seg["total_timestep"]
timesteps_so_far += MPI.COMM_WORLD.allreduce(seg["total_timestep"])
iters_so_far += 1
logger.record_tabular("EpisodesSoFar", episodes_so_far)
logger.record_tabular("TimestepsSoFar", timesteps_so_far)
Expand Down

0 comments on commit 2b67e6b

Please sign in to comment.