code: def decay_over_time(global_step, decay_config, init_value=1.0):
      r"""Returns a decayed value of `init_value` over time.
  
      When training a model with a regularizer, the objective function can be
      formulated as the following:
      $$objective = \lambda_1 * loss + \lambda_2 * regularization$$
  
      This function can be used for three cases:
  
      1. Incrementally diminishing the importance of the loss term, by applying a
         decay function to the $$\lambda_1$$ over time. We'll denote this by writing
         $$\lambda_1$$ = decay_over_time(`init_value`).
      2. Incrementally increasing the importance of the regularization term, by
         setting $$\lambda_2$$ = `init_value` - decay_over_time(`init_value`).
      3. Combining the above two cases, namely, setting $$\lambda_1$$ =
         decay_over_time(`init_value`) and $$\lambda_2$$ = `init_value` -
         decay_over_time(`init_value`).
  
      This function requires a `global_step` value to compute the decayed value.
  
      Args:
        global_step: A scalar `int32` or `int64` Tensor or a Python number. Must be
          positive.
        decay_config: A `nsl.configs.DecayConfig` for computing the decay value.
        init_value: A scalar Tensor to set the initial value to be decayed.
  
      Returns:
        A scalar `float` Tensor.
      """
      decayed_value = tf.cast(init_value, tf.dtypes.float32)
      decay_fn = _select_decay_fn(decay_config.decay_type)
      decayed_value = decay_fn(
          decayed_value,
          global_step=global_step,
          decay_steps=decay_config.decay_steps,
          decay_rate=decay_config.decay_rate,
      )
      decayed_value = tf.maximum(decayed_value, decay_config.min_value)
      return decayed_value
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import neural_structured_learning.configs
  import six
  import tensorflow
label_desc: Use image node_id 11 for calling a global function with example usage: decay_over_time(global_step, decay_config, init_value) and returns: decayed_value