Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why this difference between the local response norm paper equation and tensorflow implementation?

I came across this equation in Alex's paper on local response normalization: enter image description here

As we see above, the power is raised after we calculate the sum, multiply it with alpha and then add once k is added.

However, I see in TensorFlow documentation it is showed as

sqr_sum[a, b, c, d] =
  sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
output = input / (bias + alpha * sqr_sum ** beta)

where the beta is raised only for the sum.

Why is there a discrepancy here?

Also, when I looked into the TensorFlow code itself, I saw this:

output[b, r, c, d] /= (
            np.power(bias + alpha * np.sum(patch * patch), beta))

which looks correct?

I am kind of confused here. Can someone correct me please?

like image 247
London guy Avatar asked Jan 12 '16 11:01

London guy


People also ask

When to use local response normalization?

Local Response Normalization (LRN) was first introduced in AlexNet architecture where the activation function used was ReLU as opposed to the more common tanh and sigmoid at that time. Apart from the reason mentioned above, the reason for using LRN was to encourage lateral inhibition.

What is the function of local response normalization LRN layer in Vgg net?

Local Response Normalization (LRN) is not used by VGG since it increases memory usage and training time without improving accuracy. VGG contains three completely connected layers, the first two of which each has 4096 channels and the third of which has 1000 channels, one for each class.

What is local response?

Local Response meanss a hazardous materials emergency response in the local governmental area where team members normally conduct emergency response activities and those areas where the local government has a hazardous materials mutual response agreement in place and the responding team does not respond as a state team ...


1 Answers

This was a bug in the Tensorflow documentation.

It was fixed by this commit on Feb 26: https://github.com/tensorflow/tensorflow/commit/ab48dbd4ac2095548a5bc8505e08e751d409727f#diff-632987400e5affbcdba4533444460b0e

like image 100
Peter Hawkins Avatar answered Oct 13 '22 05:10

Peter Hawkins