Commit 35f6f9c9 authored by Neal Wu's avatar Neal Wu Committed by GitHub
Browse files

Merge pull request #1536 from awilliamson/alexnet_lrn

Implemented LRN for AlexNet tutorial
parents ea2f4704 11733fca
......@@ -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',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment