Skip to content

Commit

Permalink
Print total loss during training.
Browse files Browse the repository at this point in the history
Show the sum of all losses to make it easier to see if the training is
oscillating.
  • Loading branch information
gcp committed Dec 24, 2017
1 parent dd8722f commit f8a1a5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions training/tf/tfprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ def process(self, batch_size):
if self.time_start:
elapsed = time_end - self.time_start
speed = batch_size * (100.0 / elapsed)
print("step {}, policy loss={:g} mse={:g} reg={:g} ({:g} pos/s)".format(
steps, self.avg_policy_loss, self.avg_mse_loss, self.avg_reg_term, speed))
print("step {}, policy={:g} mse={:g} reg={:g} total={:g} ({:g} pos/s)".format(
steps, self.avg_policy_loss, self.avg_mse_loss, self.avg_reg_term,
self.avg_policy_loss + self.avg_mse_loss + self.avg_reg_term,
speed))
train_summaries = tf.Summary(value=[
tf.Summary.Value(tag="Policy Loss", simple_value=self.avg_policy_loss),
tf.Summary.Value(tag="MSE Loss", simple_value=self.avg_mse_loss)])
Expand Down

0 comments on commit f8a1a5c

Please sign in to comment.