class_docstr: Scheduling based on polynomial equation.
  
  s(t) = start_value for t < begin_step
  
       = end_value + [(start_value - end_value) * (1 - decay_term) ** exponent]
  
       where decay_term = (t - begin_step) / decay_steps
  
             for 0 <= 1 - decay_term <= 1
                 <-> 0 <= decay_term <= 1
                 <-> 0 <= (t - begin_step) / decay_steps <= 1
                 <-> 0 <= (t - begin_step) <= decay_steps
                 <-> begin_step <= t <= begin_step + decay_steps (=end_step)
  
       = end_value   for t > begin_step + decay_steps (=end_step)
docstr: Return decayed scheduled value.
docstr_tok: ["Return","decayed","scheduled","value","."]
code: def _during_decay(self, step: Union[int, tf.Tensor]) -> tf.Tensor:
      """Return decayed scheduled value."""
  
      with tf.name_scope(self.name or "PolynomialDecay"):
          local_steps = tf.cast(
              step - self.begin_step, dtype=tf.float32
          )
          decay_term = tf.math.divide(
              local_steps, tf.cast(self.decay_steps, dtype=tf.float32)
          )
          total_delta = tf.cast(
              self.start_value - self.end_value, dtype=tf.float32
          )
          target = tf.math.add(
              self.end_value,
              tf.cast(
                  tf.math.multiply(
                      total_delta, tf.pow(1 - decay_term, self.exponent)
                  ),
                  dtype=self.dtype,
              ),
          )
          val = tf.stop_gradient(target)
      return val
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/schedules.py
imports: import abc
  from typing import Union, Optional
  import tensorflow
label_desc: Use image node_id 4 for calling the PolynomialDecay obj's underlying member method code with example usage: obj._during_decay(step) and returns: val