Skip to content

Commit

Permalink
Minor PEP8 fixes in DQN.py (#600)
Browse files Browse the repository at this point in the history
* PEP8 fixes

* Update changelog.rst
  • Loading branch information
jkterry1 authored and araffin committed Dec 5, 2019
1 parent aaf9f41 commit 79646cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Others:
- Refactored test to remove duplicated code
- Add pull request template
- Replaced redundant code in load_results (@jbulow)
- Minor PEP8 fixes in dqn.py (@justinkterry)

Documentation:
^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions stable_baselines/deepq/dqn.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def learn(self, total_timesteps, callback=None, log_interval=100, tb_log_name="D
assert not self.prioritized_replay, "Prioritized replay buffer is not supported by HER"
self.replay_buffer = replay_wrapper(self.replay_buffer)


# Create the schedule for exploration starting from 1.
self.exploration = LinearSchedule(schedule_timesteps=int(self.exploration_fraction * total_timesteps),
initial_p=self.exploration_initial_eps,
Expand Down Expand Up @@ -242,7 +241,7 @@ def learn(self, total_timesteps, callback=None, log_interval=100, tb_log_name="D
# or if there are not enough samples in the replay buffer
can_sample = self.replay_buffer.can_sample(self.batch_size)
if can_sample and self.num_timesteps > self.learning_starts \
and self.num_timesteps % self.train_freq == 0:
and self.num_timesteps % self.train_freq == 0:
# Minimize the error in Bellman's equation on a batch sampled from replay buffer.
# pytype:disable=bad-unpacking
if self.prioritized_replay:
Expand Down

0 comments on commit 79646cf

Please sign in to comment.