From 8964d5ad45bfb671055563001c9ec3bd685316b5 Mon Sep 17 00:00:00 2001 From: Peter Zhokhov Date: Tue, 16 Oct 2018 14:58:23 -0700 Subject: [PATCH] flake8 and numpy.random.random_integers deprecation warning --- baselines/ddpg/ddpg.py | 2 +- baselines/ddpg/memory.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/baselines/ddpg/ddpg.py b/baselines/ddpg/ddpg.py index 79f7161..181f923 100755 --- a/baselines/ddpg/ddpg.py +++ b/baselines/ddpg/ddpg.py @@ -183,7 +183,7 @@ def learn(network, env, eval_episode_rewards = [] eval_qs = [] if eval_env is not None: - nenvsa_eval = eval_obs.shape[0] + nenvs_eval = eval_obs.shape[0] eval_episode_reward = np.zeros(nenvs_eval, dtype = np.float32) for t_rollout in range(nb_eval_steps): eval_action, eval_q, _, _ = agent.step(eval_obs, apply_noise=False, compute_Q=True) diff --git a/baselines/ddpg/memory.py b/baselines/ddpg/memory.py index 781fa71..715f4c0 100755 --- a/baselines/ddpg/memory.py +++ b/baselines/ddpg/memory.py @@ -51,7 +51,7 @@ class Memory(object): def sample(self, batch_size): # Draw such that we always have a proceeding element. - batch_idxs = np.random.random_integers(self.nb_entries - 2, size=batch_size) + batch_idxs = np.random.randint(self.nb_entries - 2, size=batch_size) obs0_batch = self.observations0.get_batch(batch_idxs) obs1_batch = self.observations1.get_batch(batch_idxs)