This repository was archived by the owner on May 21, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed
Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ def updateModel(self):
193193 next_state_mask [k ] = 1
194194
195195 # whether to calculate summaries
196- calculate_summaries = self .train_iteration % self .summary_every == 0 and self . summary_writer is not None
196+ calculate_summaries = self .summary_writer is not None and self . train_iteration % self .summary_every == 0
197197
198198 # perform one update of training
199199 cost , _ , summary_str = self .session .run ([
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ def updateModel(self):
190190 discounted_rewards [t ] = r
191191
192192 # whether to calculate summaries
193- calculate_summaries = self .train_iteration % self .summary_every == 0 and self . summary_writer is not None
193+ calculate_summaries = self .summary_writer is not None and self . train_iteration % self .summary_every == 0
194194
195195 # update policy network with the rollout in batches
196196 for t in range (N - 1 ):
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ def updateModel(self):
205205 next_state_mask [k ] = 1
206206
207207 # whether to calculate summaries
208- calculate_summaries = self .train_iteration % self .summary_every == 0 and self . summary_writer is not None
208+ calculate_summaries = self .summary_writer is not None and self . train_iteration % self .summary_every == 0
209209
210210 # compute a = u(s)
211211 policy_outs = self .session .run (self .policy_outputs , {
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ def updateModel(self):
174174 discounted_rewards /= np .std (self .all_rewards )
175175
176176 # whether to calculate summaries
177- calculate_summaries = self .train_iteration % self .summary_every == 0 and self . summary_writer is not None
177+ calculate_summaries = self .summary_writer is not None and self . train_iteration % self .summary_every == 0
178178
179179 # update policy network with the rollout in batches
180180 for t in range (N - 1 ):
You can’t perform that action at this time.
0 commit comments