# Path: morph_net/framework/generic_regularizers.py
# class NetworkRegularizer(object):  # pytype: disable=ignored-metaclass
# class OpRegularizer(object):  # pytype: disable=ignored-metaclass
#   def get_regularization_term(self, ops=None):
#   def get_cost(self, ops=None):
#   def op_regularizer_manager(self):
#   def name(self):
#   def cost_name(self):
#   def regularization_vector(self):
#   def alive_vector(self):
# def dimensions_are_compatible(op_regularizer):
# 
# Path: morph_net/framework/logistic_sigmoid_source_op_handler.py
# class LogisticSigmoidSourceOpHandler(grouping_op_handler.GroupingOpHandler):
#   def __init__(self, regularize_on_mask=True,
#                alive_threshold=0.1, mask_as_alive_vector=True):
#   def is_source_op(self):
#   def assign_grouping(self, op, op_reg_manager):
#   def create_regularizer(self, op_slice):
# 
# Path: morph_net/framework/op_handler_decorator.py
# class OpHandlerDecorator(op_handler.OpHandler):
#   def __init__(self, handler, regularizer_decorator=None,
#                decorator_parameters=None):
#   def is_source_op(self):
#   def is_passthrough(self):
#   def assign_grouping(self, op, op_reg_manager):
#   def create_regularizer(self, op_slice):
# 
# Path: morph_net/framework/op_handlers.py
# RESIZE_OP_NAMES = [
#     'ResizeArea', 'ResizeBicubic', 'ResizeBilinear', 'ResizeNearestNeighbor'
# ]
# def _get_base_op_hander_dicts():
# def get_gamma_op_handler_dict():
# def get_group_lasso_op_handler_dict():
# 
# Path: morph_net/framework/op_regularizer_manager.py
# ITERATION_LIMIT = 1000000
# class OpSlice(collections.namedtuple('OpSlice', ['op', 'slice'])):
# class Slice(collections.namedtuple('Slice', ['start_index', 'size'])):
# class OpRegularizerManager(object):
# class OpGroup(object):
#   def __str__(self):
#   def __str__(self):
#   def __init__(
#       self,
#       output_boundary: List[tf.Operation],
#       op_handler_dict=None,
#       create_grouping_regularizer=grouping_regularizers.MaxGroupingRegularizer,
#       force_group=None,
#       regularizer_blacklist=None,
#       input_boundary: List[tf.Operation] = None,
#       iteration_limit=ITERATION_LIMIT):
#   def ops(self):
#   def get_regularizer(self, op):
#   def create_op_group_for_op_slice(self, op_slice, is_source=True):
#   def group_op_slices(self, op_slices, omit_source_op_slices=None):
#   def slice_op(self, op, sizes):
#   def process_ops(self, ops):
#   def process_ops_last(self, ops):
#   def is_source_op(self, op):
#   def is_passthrough(self, op):
#   def get_op_slices(self, op):
#   def get_op_group(self, op_slice):
#   def _slice_op_slice(self, op_slice, sizes, size_index, size_count,
#                       new_op_slice_group):
#   def _slice_op_with_sizes(self, op, sizes, is_source, is_resliced):
#   def _get_source_slices(self, sizes, op_slices):
#   def _dfs_for_source_ops(self, output_boundary, input_boundary=None):
#   def _force_group_ops(self, force_group):
#   def __init__(self, op_slice=None, op_groups=None, omit_source_op_slices=None):
#   def op_slices(self):
#   def source_op_slices(self):
# 
# Path: morph_net/framework/probabilistic_grouping_regularizer.py
# class ProbabilisticGroupingRegularizer(generic_regularizers.OpRegularizer):
#   def __init__(self, regularizers_to_group):
#   def regularization_vector(self):
#   def alive_vector(self):


import abc
import six
import tensorflow.compat.v1 as tf
from typing import List, Optional, Type
from morph_net.framework import generic_regularizers
from morph_net.framework import logistic_sigmoid_source_op_handler as ls_handler
from morph_net.framework import op_handler_decorator
from morph_net.framework import op_handlers
from morph_net.framework import op_regularizer_manager as orm
from morph_net.framework import probabilistic_grouping_regularizer as pgr
"""NetworkRegularizers applied on top of probabilistic sampling."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function





@six.add_metaclass(abc.ABCMeta)
class LogisticSigmoidRegularizer(generic_regularizers.NetworkRegularizer):
  """Base class for NetworkRegularizers that use probabilistic sampling."""

  def __init__(self,
               output_boundary: List[tf.Operation],
               regularize_on_mask=True,
               alive_threshold=0.1,
               mask_as_alive_vector=True,
               regularizer_decorator: Optional[Type[

# Path: morph_net/framework/generic_regularizers.py
# class NetworkRegularizer(object):  # pytype: disable=ignored-metaclass
# class OpRegularizer(object):  # pytype: disable=ignored-metaclass
#   def get_regularization_term(self, ops=None):
#   def get_cost(self, ops=None):
#   def op_regularizer_manager(self):
#   def name(self):
#   def cost_name(self):
#   def regularization_vector(self):
#   def alive_vector(self):
# def dimensions_are_compatible(op_regularizer):
# 
# Path: morph_net/framework/logistic_sigmoid_source_op_handler.py
# class LogisticSigmoidSourceOpHandler(grouping_op_handler.GroupingOpHandler):
#   def __init__(self, regularize_on_mask=True,
#                alive_threshold=0.1, mask_as_alive_vector=True):
#   def is_source_op(self):
#   def assign_grouping(self, op, op_reg_manager):
#   def create_regularizer(self, op_slice):
# 
# Path: morph_net/framework/op_handler_decorator.py
# class OpHandlerDecorator(op_handler.OpHandler):
#   def __init__(self, handler, regularizer_decorator=None,
#                decorator_parameters=None):
#   def is_source_op(self):
#   def is_passthrough(self):
#   def assign_grouping(self, op, op_reg_manager):
#   def create_regularizer(self, op_slice):
# 
# Path: morph_net/framework/op_handlers.py
# RESIZE_OP_NAMES = [
#     'ResizeArea', 'ResizeBicubic', 'ResizeBilinear', 'ResizeNearestNeighbor'
# ]
# def _get_base_op_hander_dicts():
# def get_gamma_op_handler_dict():
# def get_group_lasso_op_handler_dict():
# 
# Path: morph_net/framework/op_regularizer_manager.py
# ITERATION_LIMIT = 1000000
# class OpSlice(collections.namedtuple('OpSlice', ['op', 'slice'])):
# class Slice(collections.namedtuple('Slice', ['start_index', 'size'])):
# class OpRegularizerManager(object):
# class OpGroup(object):
#   def __str__(self):
#   def __str__(self):
#   def __init__(
#       self,
#       output_boundary: List[tf.Operation],
#       op_handler_dict=None,
#       create_grouping_regularizer=grouping_regularizers.MaxGroupingRegularizer,
#       force_group=None,
#       regularizer_blacklist=None,
#       input_boundary: List[tf.Operation] = None,
#       iteration_limit=ITERATION_LIMIT):
#   def ops(self):
#   def get_regularizer(self, op):
#   def create_op_group_for_op_slice(self, op_slice, is_source=True):
#   def group_op_slices(self, op_slices, omit_source_op_slices=None):
#   def slice_op(self, op, sizes):
#   def process_ops(self, ops):
#   def process_ops_last(self, ops):
#   def is_source_op(self, op):
#   def is_passthrough(self, op):
#   def get_op_slices(self, op):
#   def get_op_group(self, op_slice):
#   def _slice_op_slice(self, op_slice, sizes, size_index, size_count,
#                       new_op_slice_group):
#   def _slice_op_with_sizes(self, op, sizes, is_source, is_resliced):
#   def _get_source_slices(self, sizes, op_slices):
#   def _dfs_for_source_ops(self, output_boundary, input_boundary=None):
#   def _force_group_ops(self, force_group):
#   def __init__(self, op_slice=None, op_groups=None, omit_source_op_slices=None):
#   def op_slices(self):
#   def source_op_slices(self):
# 
# Path: morph_net/framework/probabilistic_grouping_regularizer.py
# class ProbabilisticGroupingRegularizer(generic_regularizers.OpRegularizer):
#   def __init__(self, regularizers_to_group):
#   def regularization_vector(self):
#   def alive_vector(self):


# Path: morph_net/network_regularizers/logistic_sigmoid_regularizer.py
import abc
import six
import tensorflow.compat.v1 as tf
from typing import List, Optional, Type
from morph_net.framework import generic_regularizers
from morph_net.framework import logistic_sigmoid_source_op_handler as ls_handler
from morph_net.framework import op_handler_decorator
from morph_net.framework import op_handlers
from morph_net.framework import op_regularizer_manager as orm
from morph_net.framework import probabilistic_grouping_regularizer as pgr

"""NetworkRegularizers applied on top of probabilistic sampling."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function





@six.add_metaclass(abc.ABCMeta)
class LogisticSigmoidRegularizer(generic_regularizers.NetworkRegularizer):
  """Base class for NetworkRegularizers that use probabilistic sampling."""

  def __init__(self,
               output_boundary: List[tf.Operation],
               regularize_on_mask=True,
               alive_threshold=0.1,
               mask_as_alive_vector=True,
               regularizer_decorator: Optional[Type[

                   generic_regularizers.OpRegularizer]] = None,