We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6daba3b + d821ab8 commit f478547Copy full SHA for f478547
official/resnet/resnet_run_loop.py
@@ -235,9 +235,11 @@ def exclude_batch_norm(name):
235
loss_filter_fn = loss_filter_fn or exclude_batch_norm
236
237
# Add weight decay to the loss.
238
- loss = cross_entropy + weight_decay * tf.add_n(
+ l2_loss = weight_decay * tf.add_n(
239
[tf.nn.l2_loss(v) for v in tf.trainable_variables()
240
if loss_filter_fn(v.name)])
241
+ tf.summary.scalar('l2_loss', l2_loss)
242
+ loss = cross_entropy + l2_loss
243
244
if mode == tf.estimator.ModeKeys.TRAIN:
245
global_step = tf.train.get_or_create_global_step()
0 commit comments