# Implementing Local response Normalization in tf.keras model

**URL:** <https://discuss.ai.google.dev/t/implementing-local-response-normalization-in-tf-keras-model/22814>\
**Category:** General Discussion\
**Tags:** education, help\_request\
**Created:** [January 30, 2022, 1:11pm UTC](https://discuss.ai.google.dev/t/implementing-local-response-normalization-in-tf-keras-model/22814 "2022-01-30T13:11:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikhil\_Mudgal](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/nikhil_mudgal/32/8482_2.png) [@Nikhil\_Mudgal](https://discuss.ai.google.dev/u/Nikhil_Mudgal)\
**Post date:** [January 30, 2022, 1:11pm UTC](https://discuss.ai.google.dev/t/implementing-local-response-normalization-in-tf-keras-model/22814/1 "2022-01-30T13:11:53Z")

</div>

How can I create and implement Local response Normalization using tensor ops and implement it in my tf.keras models. And should I use it in modern CNN’s? why or why not?

Expression for the Norm :-

 ![req](https://d3qe71uytubmmx.cloudfront.net/original/2X/a/ab710483d8a2ce4863824eaa0016d0a94dec457e.png)

---

<div class="post-metadata">

**Author:** ![Bhack](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/bhack/32/6388_2.png) [@Bhack](https://discuss.ai.google.dev/u/Bhack)\
**Post date:** [January 30, 2022, 4:12pm UTC](https://discuss.ai.google.dev/t/implementing-local-response-normalization-in-tf-keras-model/22814/3 "2022-01-30T16:12:13Z")

</div>

You can this a Keras lambda layer:

> **[tf.nn.local\_response\_normalization  |  TensorFlow v2.16.1](https://www.tensorflow.org/api_docs/python/tf/nn/local_response_normalization)**
>
> Local Response Normalization.

It was requested in Keras many times, I think the last one was:

> <https://github.com/keras-team/keras/issues/6598>
>
> LRN has been \[removed\](https://github.com/fchollet/keras/pull/331#issuecomment-1…68585710), maybe in favor of Batch Normalization. The problem is, in my experiments BN layer after a Conv Layer didn't perform well. It performs well on the 5th and 6th Dense layer, but not on the Conv layer
> So, why don't you let the user the choice what they want to use?
