diff --git a/tutorials/image/alexnet/alexnet_benchmark.py b/tutorials/image/alexnet/alexnet_benchmark.py index ed723055ca..39fcb109f0 100644 --- a/tutorials/image/alexnet/alexnet_benchmark.py +++ b/tutorials/image/alexnet/alexnet_benchmark.py @@ -74,10 +74,15 @@ def inference(images): parameters += [kernel, biases] # lrn1 - # TODO(shlens, jiayq): Add a GPU version of local response normalization. + with tf.name_scope('lrn1') as scope: + lrn1 = tf.nn.local_response_normalization(conv1, + alpha=1e-4, + beta=0.75, + depth_radius=2, + bias=2.0) # pool1 - pool1 = tf.nn.max_pool(conv1, + pool1 = tf.nn.max_pool(lrn1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID', @@ -96,8 +101,16 @@ def inference(images): parameters += [kernel, biases] print_activations(conv2) + # lrn2 + with tf.name_scope('lrn2') as scope: + lrn2 = tf.nn.local_response_normalization(conv2, + alpha=1e-4, + beta=0.75, + depth_radius=2, + bias=2.0) + # pool2 - pool2 = tf.nn.max_pool(conv2, + pool2 = tf.nn.max_pool(lrn2, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID',