Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from islamelnabarawy/fix-datawriter-condition
Browse files Browse the repository at this point in the history
Fix error in the way learners check for the presence of a summary writer
  • Loading branch information
yukezhu authored Oct 31, 2017
2 parents f3f2321 + b5bf6ae commit 173a04f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rl/neural_q_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def updateModel(self):
next_state_mask[k] = 1

# whether to calculate summaries
calculate_summaries = self.train_iteration % self.summary_every == 0 and self.summary_writer is not None
calculate_summaries = self.summary_writer is not None and self.train_iteration % self.summary_every == 0

# perform one update of training
cost, _, summary_str = self.session.run([
Expand Down
2 changes: 1 addition & 1 deletion rl/pg_actor_critic.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def updateModel(self):
discounted_rewards[t] = r

# whether to calculate summaries
calculate_summaries = self.train_iteration % self.summary_every == 0 and self.summary_writer is not None
calculate_summaries = self.summary_writer is not None and self.train_iteration % self.summary_every == 0

# update policy network with the rollout in batches
for t in range(N-1):
Expand Down
2 changes: 1 addition & 1 deletion rl/pg_ddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def updateModel(self):
next_state_mask[k] = 1

# whether to calculate summaries
calculate_summaries = self.train_iteration % self.summary_every == 0 and self.summary_writer is not None
calculate_summaries = self.summary_writer is not None and self.train_iteration % self.summary_every == 0

# compute a = u(s)
policy_outs = self.session.run(self.policy_outputs, {
Expand Down
2 changes: 1 addition & 1 deletion rl/pg_reinforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def updateModel(self):
discounted_rewards /= np.std(self.all_rewards)

# whether to calculate summaries
calculate_summaries = self.train_iteration % self.summary_every == 0 and self.summary_writer is not None
calculate_summaries = self.summary_writer is not None and self.train_iteration % self.summary_every == 0

# update policy network with the rollout in batches
for t in range(N-1):
Expand Down

0 comments on commit 173a04f

Please sign in to comment.