# Path: tensorflow_constrained_optimization/python/constrained_minimization_problem.py
# class ConstrainedMinimizationProblem(tf.Module):
#   def __init__(self, name=None):
#   def objective(self):
#   def num_constraints(self):
#   def constraints(self):
#   def proxy_constraints(self):
#   def components(self):
#   def update_ops(self):
# 
# Path: tensorflow_constrained_optimization/python/rates/constraint.py
# class Constraint(helpers.RateObject):
# class ConstraintList(helpers.UniqueList):
#   def __init__(self, expression):
#   def expression(self):
#   def __init__(self, collection=None):
# 
# Path: tensorflow_constrained_optimization/python/rates/defaults.py
# DENOMINATOR_LOWER_BOUND_KEY = "denominator_lower_bound"
# GLOBAL_STEP_KEY = "global_step"
# VARIABLE_FN_KEY = "variable_fn"
# DEFAULT_PENALTY_LOSS = loss.HingeLoss()
# DEFAULT_CONSTRAINT_LOSS = loss.ZeroOneLoss()
# 
# Path: tensorflow_constrained_optimization/python/rates/deferred_tensor.py
# class _DeferredTensorInput(helpers.RateObject):
# class DeferredTensor(helpers.RateObject):
# class _DerivedDeferredTensor(DeferredTensor):
# class ExplicitDeferredTensor(DeferredTensor):
# class DeferredVariable(DeferredTensor):
# class DeferredTensorInputList(helpers.RateObject):
# class DeferredVariableList(helpers.UniqueList):
#   def _list_to_tuple(cls, arg):
#   def __init__(self, value):
#   def value(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __call__(self, structure_memoizer, value_memoizer=None):
#   def apply(cls, callback, *args):
#   def __neg__(self):
#   def __lt__(self, other):
#   def __le__(self, other):
#   def __gt__(self, other):
#   def __ge__(self, other):
#   def __add__(self, other):
#   def __radd__(self, other):
#   def __sub__(self, other):
#   def __rsub__(self, other):
#   def __mul__(self, other):
#   def __rmul__(self, other):
#   def __truediv__(self, other):
#   def __rtruediv__(self, other):
#   def __getitem__(self, slice_spec):
#   def __init__(self, callback, args):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __init__(self, value, auto_cast=False):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __init__(self,
#                initial_value,
#                trainable=None,
#                name=None,
#                dtype=None,
#                constraint=None,
#                update_ops_fn=None,
#                auto_cast=False):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def create(self, structure_memoizer):
#   def update_ops(self, structure_memoizer, value_memoizer=None):
#   def __init__(self, collection=None):
#   def list(self):
#   def append(self, element):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __len__(self):
#   def __iter__(self):
#   def __add__(self, other):
#   def __radd__(self, other):
#   def __getitem__(self, slice_spec):
#   def __init__(self, collection=None):


import tensorflow as tf
from tensorflow_constrained_optimization.python import constrained_minimization_problem
from tensorflow_constrained_optimization.python.rates import constraint
from tensorflow_constrained_optimization.python.rates import defaults
from tensorflow_constrained_optimization.python.rates import deferred_tensor
    its own placeholder tensors.

    Args:
      objective: an `Expression` to minimize.
      constraints: a collection of `Constraint`s to impose.
      denominator_lower_bound: float, the smallest permitted value of the
        denominator of a rate.
      variable_fn: optional function with the same signature as the
        `tf.Variable` constructor, that returns a new variable with the
        specified properties.
      name: optional string, the name of this object.

    Raises:
      ValueError: if the "penalty" portion of the objective or a constraint is
        non-differentiable, or if denominator_lower_bound is negative.
    """
    super(RateMinimizationProblem, self).__init__(name=name)

    # We do permit denominator_lower_bound to be zero. In this case, division by
    # zero is possible, and it's the user's responsibility to ensure that it
    # doesn't happen.
    if denominator_lower_bound < 0.0:
      raise ValueError("denominator lower bound must be non-negative")
    # The objective needs to be differentiable. So do the penalty portions of
    # the constraints, but we'll check those later.
    if not objective.penalty_expression.is_differentiable:
      raise ValueError("non-differentiable losses (e.g. the zero-one loss) "
                       "cannot be optimized--they can only be constrained")

    inputs = deferred_tensor.DeferredTensorInputList()

# Path: tensorflow_constrained_optimization/python/constrained_minimization_problem.py
# class ConstrainedMinimizationProblem(tf.Module):
#   def __init__(self, name=None):
#   def objective(self):
#   def num_constraints(self):
#   def constraints(self):
#   def proxy_constraints(self):
#   def components(self):
#   def update_ops(self):
# 
# Path: tensorflow_constrained_optimization/python/rates/constraint.py
# class Constraint(helpers.RateObject):
# class ConstraintList(helpers.UniqueList):
#   def __init__(self, expression):
#   def expression(self):
#   def __init__(self, collection=None):
# 
# Path: tensorflow_constrained_optimization/python/rates/defaults.py
# DENOMINATOR_LOWER_BOUND_KEY = "denominator_lower_bound"
# GLOBAL_STEP_KEY = "global_step"
# VARIABLE_FN_KEY = "variable_fn"
# DEFAULT_PENALTY_LOSS = loss.HingeLoss()
# DEFAULT_CONSTRAINT_LOSS = loss.ZeroOneLoss()
# 
# Path: tensorflow_constrained_optimization/python/rates/deferred_tensor.py
# class _DeferredTensorInput(helpers.RateObject):
# class DeferredTensor(helpers.RateObject):
# class _DerivedDeferredTensor(DeferredTensor):
# class ExplicitDeferredTensor(DeferredTensor):
# class DeferredVariable(DeferredTensor):
# class DeferredTensorInputList(helpers.RateObject):
# class DeferredVariableList(helpers.UniqueList):
#   def _list_to_tuple(cls, arg):
#   def __init__(self, value):
#   def value(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __call__(self, structure_memoizer, value_memoizer=None):
#   def apply(cls, callback, *args):
#   def __neg__(self):
#   def __lt__(self, other):
#   def __le__(self, other):
#   def __gt__(self, other):
#   def __ge__(self, other):
#   def __add__(self, other):
#   def __radd__(self, other):
#   def __sub__(self, other):
#   def __rsub__(self, other):
#   def __mul__(self, other):
#   def __rmul__(self, other):
#   def __truediv__(self, other):
#   def __rtruediv__(self, other):
#   def __getitem__(self, slice_spec):
#   def __init__(self, callback, args):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __init__(self, value, auto_cast=False):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def __init__(self,
#                initial_value,
#                trainable=None,
#                name=None,
#                dtype=None,
#                constraint=None,
#                update_ops_fn=None,
#                auto_cast=False):
#   def _value_and_auto_cast(self, structure_memoizer, value_memoizer):
#   def inputs(self):
#   def variables(self):
#   def __hash__(self):
#   def __eq__(self, other):
#   def create(self, structure_memoizer):
#   def update_ops(self, structure_memoizer, value_memoizer=None):
#   def __init__(self, collection=None):
#   def list(self):
#   def append(self, element):
#   def __eq__(self, other):
#   def __ne__(self, other):
#   def __len__(self):
#   def __iter__(self):
#   def __add__(self, other):
#   def __radd__(self, other):
#   def __getitem__(self, slice_spec):
#   def __init__(self, collection=None):


# Path: tensorflow_constrained_optimization/python/rates/rate_minimization_problem.py
import tensorflow as tf
from tensorflow_constrained_optimization.python import constrained_minimization_problem
from tensorflow_constrained_optimization.python.rates import constraint
from tensorflow_constrained_optimization.python.rates import defaults
from tensorflow_constrained_optimization.python.rates import deferred_tensor

    its own placeholder tensors.

    Args:
      objective: an `Expression` to minimize.
      constraints: a collection of `Constraint`s to impose.
      denominator_lower_bound: float, the smallest permitted value of the
        denominator of a rate.
      variable_fn: optional function with the same signature as the
        `tf.Variable` constructor, that returns a new variable with the
        specified properties.
      name: optional string, the name of this object.

    Raises:
      ValueError: if the "penalty" portion of the objective or a constraint is
        non-differentiable, or if denominator_lower_bound is negative.
    """
    super(RateMinimizationProblem, self).__init__(name=name)

    # We do permit denominator_lower_bound to be zero. In this case, division by
    # zero is possible, and it's the user's responsibility to ensure that it
    # doesn't happen.
    if denominator_lower_bound < 0.0:
      raise ValueError("denominator lower bound must be non-negative")
    # The objective needs to be differentiable. So do the penalty portions of
    # the constraints, but we'll check those later.
    if not objective.penalty_expression.is_differentiable:
      raise ValueError("non-differentiable losses (e.g. the zero-one loss) "
                       "cannot be optimized--they can only be constrained")

    inputs = deferred_tensor.DeferredTensorInputList()

    variables = deferred_tensor.DeferredVariableList()