# 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
              tf.cast(num_min_diff_examples, dtype=tf.float32)))

      if self.enable_summary_histogram:
        # Plot histogram of the MinDiff predictions.
        summary_histogram = (
            tf.summary.histogram
        )

        summary_histogram('min_diff_prediction_histogram', predictions)

        # Plot histogram of the MinDiff predictions for each membership class.
        # Pick out only min_diff head training data
        pos_mask = tf.dtypes.cast(weights, tf.float32) * tf.cast(
            tf.equal(membership, 1.0), tf.float32)
        neg_mask = tf.dtypes.cast(weights, tf.float32) * tf.cast(
            tf.equal(membership, 0.0), tf.float32)

        if predictions.shape.dims:
          sensitive_group_predictions = tf.squeeze(
              tf.gather(predictions, indices=tf.where(pos_mask[:, 0])))
          non_sensitive_group_predictions = tf.squeeze(
              tf.gather(predictions, indices=tf.where(neg_mask[:, 0])))

          summary_histogram('min_diff_sensitive_group_prediction_histogram',
                            sensitive_group_predictions)
          summary_histogram('min_diff_non-sensitive_group_prediction_histogram',
                            non_sensitive_group_predictions)

      return loss


# 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

              tf.cast(num_min_diff_examples, dtype=tf.float32)))

      if self.enable_summary_histogram:
        # Plot histogram of the MinDiff predictions.
        summary_histogram = (
            tf.summary.histogram
        )

        summary_histogram('min_diff_prediction_histogram', predictions)

        # Plot histogram of the MinDiff predictions for each membership class.
        # Pick out only min_diff head training data
        pos_mask = tf.dtypes.cast(weights, tf.float32) * tf.cast(
            tf.equal(membership, 1.0), tf.float32)
        neg_mask = tf.dtypes.cast(weights, tf.float32) * tf.cast(
            tf.equal(membership, 0.0), tf.float32)

        if predictions.shape.dims:
          sensitive_group_predictions = tf.squeeze(
              tf.gather(predictions, indices=tf.where(pos_mask[:, 0])))
          non_sensitive_group_predictions = tf.squeeze(
              tf.gather(predictions, indices=tf.where(neg_mask[:, 0])))

          summary_histogram('min_diff_sensitive_group_prediction_histogram',
                            sensitive_group_predictions)
          summary_histogram('min_diff_non-sensitive_group_prediction_histogram',
                            non_sensitive_group_predictions)

      return loss


  @docs.doc_private