瀏覽代碼

Do not perform averaging of the cost.

The moving average object was shared between training and evaluation. As
a result, the cost during evaluation was averaged with the training
cost. This affects only objective, not precision.
Michael Figurnov 9 年之前
父節點
當前提交
dc3402395f
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      resnet/resnet_model.py

+ 1 - 4
resnet/resnet_model.py

@@ -122,10 +122,7 @@ class ResNet(object):
       self.cost = tf.reduce_mean(xent, name='xent')
       self.cost += self._decay()
 
-      moving_avg = tf.train.ExponentialMovingAverage(
-          0.99, num_updates=self.global_step, name='moving_avg')
-      self._extra_train_ops.append(moving_avg.apply([self.cost]))
-      tf.scalar_summary('cost', moving_avg.average(self.cost))
+      tf.scalar_summary('cost', self.cost)
 
   def _build_train_op(self):
     """Build training specific ops for the graph."""