runtime-modeling/model_def.py
def round_filters(filters, global_params):
  """Round number of filters based on depth multiplier."""
  multiplier = global_params.depth_multiplier
  # dstam addition
  if multiplier > 10:
    multiplier = float(multiplier) / 100

  divisor = global_params.depth_divisor
  min_depth = global_params.min_depth
  if not multiplier:
    return filters

  filters *= multiplier
  min_depth = min_depth or divisor
  new_filters = max(min_depth, int(filters + divisor / 2) // divisor * divisor)
  # Make sure that round down does not go down by more than 10%.
  if new_filters < 0.9 * filters:
    new_filters += divisor
  return int(new_filters)
Round number of filters based on depth multiplier.
Round number of filters based on depth multiplier.
Round number of filters based on depth multiplier .
def round_filters(filters, global_params):
  multiplier = global_params.depth_multiplier
  if multiplier > 10:
    multiplier = float(multiplier) / 100
  divisor = global_params.depth_divisor
  min_depth = global_params.min_depth
  if not multiplier:
    return filters
  filters *= multiplier
  min_depth = min_depth or divisor
  new_filters = max(min_depth, int(filters + divisor / 2) // divisor * divisor)
  if new_filters < 0.9 * filters:
    new_filters += divisor
  return int(new_filters)
def round_filters ( filters , global_params ) : multiplier = global_params . depth_multiplier if multiplier > 10 : multiplier = float ( multiplier ) / 100 divisor = global_params . depth_divisor min_depth = global_params . min_depth if not multiplier : return filters filters *= multiplier min_depth = min_depth or divisor new_filters = max ( min_depth , int ( filters + divisor / 2 ) // divisor * divisor ) if new_filters < 0.9 * filters : new_filters += divisor return int ( new_filters )
Round number of filters based on depth multiplier.
Round number of filters based on depth multiplier .
"""Round number of filters based on depth multiplier.""" # dstam addition # Make sure that round down does not go down by more than 10%.
filters
global_params