prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Documentation for Snake activation function is incorrect
  **System information**
  - OS Platform and Distribution (e.g., Linux Ubuntu 16.04): NA
  - TensorFlow version and how it was installed (source or binary): NA 
  - TensorFlow-Addons version and how it was installed (source or binary): NA
  - Python version: NA
  - Is GPU used? (yes/no): NA
  
  **Describe the bug**
  
  Documentation for Snake activation function is incorrect. The current documentation says this:
  ![image](https://user-images.githubusercontent.com/40834245/133940822-d67e82ab-63e2-4445-ba96-b9c3102f6818.png)
  
  Ref: https://www.tensorflow.org/addons/api_docs/python/tfa/activations/snake
  
  
  But, `x` should be out of the fraction to make it consistent with the original paper as well as the code.
  
  Actual: 
  ![image](https://user-images.githubusercontent.com/40834245/133940792-1966e5e4-fae2-4180-9492-27d489df63e4.png)
  
  Reference: https://arxiv.org/abs/2006.08195
  
  **Code to reproduce the issue**
  
  NA
  
  **Other info / logs**
  
  NA
  
  
  </issue>
  <code>
  [start of tensorflow_addons/activations/snake.py]
  1 # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 # ==============================================================================
  15 
  16 import tensorflow as tf
  17 
  18 from tensorflow_addons.utils import types
  19 
  20 
  21 @tf.keras.utils.register_keras_serializable(package="Addons")
  22 def snake(x: types.TensorLike, frequency: types.Number = 1) -> tf.Tensor:
  23     r"""Snake activation to learn periodic functions.
  24 
  25     Computes snake activation:
  26 
  27     $$
  28     \mathrm{snake}(x) = \frac{x + (1 - \cos(2 \cdot \mathrm{frequency} \cdot x))}{2 \cdot \mathrm{frequency}}.
  29     $$
  30 
  31     See [Neural Networks Fail to Learn Periodic Functions and How to Fix It](https://arxiv.org/abs/2006.08195).
  32 
  33     Usage:
  34 
  35     >>> x = tf.constant([-1.0, 0.0, 1.0])
  36     >>> tfa.activations.snake(x)
  37     <tf.Tensor: shape=(3,), dtype=float32, numpy=array([-0.29192656,  0.        ,  1.7080734 ], dtype=float32)>
  38 
  39     Args:
  40         x: A `Tensor`.
  41         frequency: A scalar, frequency of the periodic part.
  42     Returns:
  43         A `Tensor`. Has the same type as `x`.
  44     """
  45     x = tf.convert_to_tensor(x)
  46     frequency = tf.cast(frequency, x.dtype)
  47 
  48     return x + (1 - tf.cos(2 * frequency * x)) / (2 * frequency)
  49
  [end of tensorflow_addons/activations/snake.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/tensorflow_addons/activations/snake.py b/tensorflow_addons/activations/snake.py
  --- a/tensorflow_addons/activations/snake.py
  +++ b/tensorflow_addons/activations/snake.py
  @@ -25,7 +25,7 @@
       Computes snake activation:
   
       $$
  -    \mathrm{snake}(x) = \frac{x + (1 - \cos(2 \cdot \mathrm{frequency} \cdot x))}{2 \cdot \mathrm{frequency}}.
  +    \mathrm{snake}(x) = \mathrm{x} + \frac{1 - \cos(2 \cdot \mathrm{frequency} \cdot x)}{2 \cdot \mathrm{frequency}}.
       $$
   
       See [Neural Networks Fail to Learn Periodic Functions and How to Fix It](https://arxiv.org/abs/2006.08195).
  
verification_info: {"golden_diff": "diff --git a/tensorflow_addons/activations/snake.py b/tensorflow_addons/activations/snake.py\n--- a/tensorflow_addons/activations/snake.py\n+++ b/tensorflow_addons/activations/snake.py\n@@ -25,7 +25,7 @@\n     Computes snake activation:\n \n     $$\n-    \\mathrm{snake}(x) = \\frac{x + (1 - \\cos(2 \\cdot \\mathrm{frequency} \\cdot x))}{2 \\cdot \\mathrm{frequency}}.\n+    \\mathrm{snake}(x) = \\mathrm{x} + \\frac{1 - \\cos(2 \\cdot \\mathrm{frequency} \\cdot x)}{2 \\cdot \\mathrm{frequency}}.\n     $$\n \n     See [Neural Networks Fail to Learn Periodic Functions and How to Fix It](https://arxiv.org/abs/2006.08195).\n", "issue": "Documentation for Snake activation function is incorrect\n**System information**\r\n- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): NA\r\n- TensorFlow version and how it was installed (source or binary): NA \r\n- TensorFlow-Addons version and how it was installed (source or binary): NA\r\n- Python version: NA\r\n- Is GPU used? (yes/no): NA\r\n\r\n**Describe the bug**\r\n\r\nDocumentation for Snake activation function is incorrect. The current documentation says this:\r\n![image](https://user-images.githubusercontent.com/40834245/133940822-d67e82ab-63e2-4445-ba96-b9c3102f6818.png)\r\n\r\nRef: https://www.tensorflow.org/addons/api_docs/python/tfa/activations/snake\r\n\r\n\r\nBut, `x` should be out of the fraction to make it consistent with the original paper as well as the code.\r\n\r\nActual: \r\n![image](https://user-images.githubusercontent.com/40834245/133940792-1966e5e4-fae2-4180-9492-27d489df63e4.png)\r\n\r\nReference: https://arxiv.org/abs/2006.08195\r\n\r\n**Code to reproduce the issue**\r\n\r\nNA\r\n\r\n**Other info / logs**\r\n\r\nNA\r\n\n", "before_files": [{"content": "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# ==============================================================================\n\nimport tensorflow as tf\n\nfrom tensorflow_addons.utils import types\n\n\n@tf.keras.utils.register_keras_serializable(package=\"Addons\")\ndef snake(x: types.TensorLike, frequency: types.Number = 1) -> tf.Tensor:\n    r\"\"\"Snake activation to learn periodic functions.\n\n    Computes snake activation:\n\n    $$\n    \\mathrm{snake}(x) = \\frac{x + (1 - \\cos(2 \\cdot \\mathrm{frequency} \\cdot x))}{2 \\cdot \\mathrm{frequency}}.\n    $$\n\n    See [Neural Networks Fail to Learn Periodic Functions and How to Fix It](https://arxiv.org/abs/2006.08195).\n\n    Usage:\n\n    >>> x = tf.constant([-1.0, 0.0, 1.0])\n    >>> tfa.activations.snake(x)\n    <tf.Tensor: shape=(3,), dtype=float32, numpy=array([-0.29192656,  0.        ,  1.7080734 ], dtype=float32)>\n\n    Args:\n        x: A `Tensor`.\n        frequency: A scalar, frequency of the periodic part.\n    Returns:\n        A `Tensor`. Has the same type as `x`.\n    \"\"\"\n    x = tf.convert_to_tensor(x)\n    frequency = tf.cast(frequency, x.dtype)\n\n    return x + (1 - tf.cos(2 * frequency * x)) / (2 * frequency)\n", "path": "tensorflow_addons/activations/snake.py"}]}