# Path: tensorflow_model_remediation/common/docs.py
# def _no_op_decorator(obj):
# def _get_safe_decorator(decorator_name):
# 
# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
# _STRING_TO_KERNEL_DICT = {}
# def _register_kernel_names(kernel_class, names):
# def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
#                 kernel_var_name: str = 'kernel'):


import abc
import re
import dill
import tensorflow as tf
from typing import Optional, Tuple
from tensorflow_model_remediation.common import docs
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import kernel_utils

  If the predictions between the two groups are indistinguishable, the loss
  should be 0. The more different the two scores are, the higher the loss.
  """
  # pyformat: enable

  def __init__(self,
               membership_transform=None,
               predictions_transform=None,
               membership_kernel=None,
               predictions_kernel=None,
               name: Optional[str] = None,
               enable_summary_histogram: Optional[bool] = True):

    """Initialize `MinDiffLoss` instance.

    Raises:
      ValueError: If a `*_transform` parameter is passed in but is not callable.
      ValueError: If a `*_kernel` parameter has an unrecognized type or value.
    """
    super(MinDiffLoss, self).__init__(
        reduction=tf.keras.losses.Reduction.NONE, name=name)
    self.name = name or _to_snake_case(self.__class__.__name__)
    _validate_transform(membership_transform, 'membership_transform')
    self.membership_transform = (membership_transform)
    _validate_transform(predictions_transform, 'predictions_transform')
    self.predictions_transform = predictions_transform

    self.membership_kernel = kernel_utils._get_kernel(membership_kernel,
                                                      'membership_kernel')

# Path: tensorflow_model_remediation/common/docs.py
# def _no_op_decorator(obj):
# def _get_safe_decorator(decorator_name):
# 
# Path: tensorflow_model_remediation/common/types.py

# 
# Path: tensorflow_model_remediation/min_diff/losses/kernels/kernel_utils.py
# _STRING_TO_KERNEL_DICT = {}
# def _register_kernel_names(kernel_class, names):
# def _get_kernel(kernel: Union[base_kernel.MinDiffKernel, str],
#                 kernel_var_name: str = 'kernel'):


# Path: tensorflow_model_remediation/min_diff/losses/base_loss.py
import abc
import re
import dill
import tensorflow as tf
from typing import Optional, Tuple
from tensorflow_model_remediation.common import docs
from tensorflow_model_remediation.common import types
from tensorflow_model_remediation.min_diff.losses.kernels import kernel_utils


  If the predictions between the two groups are indistinguishable, the loss
  should be 0. The more different the two scores are, the higher the loss.
  """
  # pyformat: enable

  def __init__(self,
               membership_transform=None,
               predictions_transform=None,
               membership_kernel=None,
               predictions_kernel=None,
               name: Optional[str] = None,
               enable_summary_histogram: Optional[bool] = True):

    """Initialize `MinDiffLoss` instance.

    Raises:
      ValueError: If a `*_transform` parameter is passed in but is not callable.
      ValueError: If a `*_kernel` parameter has an unrecognized type or value.
    """
    super(MinDiffLoss, self).__init__(
        reduction=tf.keras.losses.Reduction.NONE, name=name)
    self.name = name or _to_snake_case(self.__class__.__name__)
    _validate_transform(membership_transform, 'membership_transform')
    self.membership_transform = (membership_transform)
    _validate_transform(predictions_transform, 'predictions_transform')
    self.predictions_transform = predictions_transform

    self.membership_kernel = kernel_utils._get_kernel(membership_kernel,
                                                      'membership_kernel')

    self.predictions_kernel = kernel_utils._get_kernel(predictions_kernel,