title: how do I implement Gaussian blurring layer in Keras?
body: <p>I have an autoencoder and I need to add a Gaussian noise layer after my output. I need a custom layer to do this, but I really do not know how to produce it, I need to produce it using tensors.
  <a href="https://i.stack.imgur.com/34nu2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/34nu2.png" alt="enter image description here"></a></p>
  
  <p>what should I do if I want to implement the above equation in the call part of the following code?</p>
  
  <pre><code>class SaltAndPepper(Layer):
  
      def __init__(self, ratio, **kwargs):
          super(SaltAndPepper, self).__init__(**kwargs)
          self.supports_masking = True
          self.ratio = ratio
  
      # the definition of the call method of custom layer
      def call(self, inputs, training=None):
          def noised():
              shp = K.shape(inputs)[1:]
  
           **what should I put here????**            
                  return out
  
          return K.in_train_phase(noised(), inputs, training=training)
  
      def get_config(self):
          config = {'ratio': self.ratio}
          base_config = super(SaltAndPepper, self).get_config()
          return dict(list(base_config.items()) + list(config.items()))
  </code></pre>
  
  <p>I also try to implement using lambda layer but it dose not work.</p>