# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/base_kernel.py
# class MinDiffKernel(abc.ABC):
#   def __init__(self, tile_input: bool = True):
#   def __call__(self,
#                x: types.TensorType,
#                y: Optional[types.TensorType] = None) -> types.TensorType:
#   def call(self, x: types.TensorType, y: types.TensorType):
#   def get_config(self):
#   def from_config(cls, config):


import tensorflow as tf
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import base_kernel
  The Gaussian kernel is a mathematical tool that approximates a given
  distribution as a sum of gaussian distributions. This is particularly useful
  when we are trying to determine a distribution from a set of points.

  Arguments:
    kernel_length: Length (sometimes also called 'width') of the kernel.
      Defaults to `0.1`. This parameter essentially describes how far apart
      points can be and still affect each other.

      The choice for kernel length should be influenced by the average distance
      of inputs. The smaller the distance, the smaller the kernel length likely
      needs to be for best performance. In general, a good first guess is the
      standard deviation of your predictions.

      Note: A kernel length that is too large will result in losing most of the
      kernel's non-linearity making it much less effective. A kernel length
      that is too small will make the kernel highly sensitive to input noise
      potentially leading to unstable results.
    **kwargs: Named parameters that will be passed directly to the base
      class' `__init__` function.

  See [paper](https://arxiv.org/abs/1910.11779) for reference on how it can be
  used in MinDiff.
  """
  # pyformat: enable

  def __init__(self, kernel_length: complex = 0.1, **kwargs):
    super(GaussianKernel, self).__init__(**kwargs)
    self.kernel_length = kernel_length


# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/base_kernel.py
# class MinDiffKernel(abc.ABC):
#   def __init__(self, tile_input: bool = True):
#   def __call__(self,
#                x: types.TensorType,
#                y: Optional[types.TensorType] = None) -> types.TensorType:
#   def call(self, x: types.TensorType, y: types.TensorType):
#   def get_config(self):
#   def from_config(cls, config):


# Path: tensorflow_model_remediation/min_diff/losses/kernels/gaussian_kernel.py
import tensorflow as tf
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import base_kernel

  The Gaussian kernel is a mathematical tool that approximates a given
  distribution as a sum of gaussian distributions. This is particularly useful
  when we are trying to determine a distribution from a set of points.

  Arguments:
    kernel_length: Length (sometimes also called 'width') of the kernel.
      Defaults to `0.1`. This parameter essentially describes how far apart
      points can be and still affect each other.

      The choice for kernel length should be influenced by the average distance
      of inputs. The smaller the distance, the smaller the kernel length likely
      needs to be for best performance. In general, a good first guess is the
      standard deviation of your predictions.

      Note: A kernel length that is too large will result in losing most of the
      kernel's non-linearity making it much less effective. A kernel length
      that is too small will make the kernel highly sensitive to input noise
      potentially leading to unstable results.
    **kwargs: Named parameters that will be passed directly to the base
      class' `__init__` function.

  See [paper](https://arxiv.org/abs/1910.11779) for reference on how it can be
  used in MinDiff.
  """
  # pyformat: enable

  def __init__(self, kernel_length: complex = 0.1, **kwargs):
    super(GaussianKernel, self).__init__(**kwargs)
    self.kernel_length = kernel_length


  def call(self, x: types.TensorType, y: types.TensorType) -> types.TensorType: