(train_time, num_resolutions,
                               num_blocks, stage_times)
return progress
Computes the same progress value as compute_progress.

  Assumes training proceeds according to a schedule specified by stage_times
  and train_time is the amount of elapsed time so far.

  Args:
    train_time:
    num_resolutions:
    num_blocks: Number of network blocks.
    stage_times:

  Returns:
    progress: A scalar float `Tensor` of the training progress.
Computes the same progress value as compute_progress.
Computes the same progress value as compute_progress .
def compute_progress_from_time(train_time, num_resolutions,
                               num_blocks, stage_times):
  """Computes the same progress value as compute_progress.

  Assumes training proceeds according to a schedule specified by stage_times
  and train_time is the amount of elapsed time so far.

  Args:
    train_time:
    num_resolutions:
    num_blocks: Number of network blocks.
    stage_times:

  Returns:
    progress: A scalar float `Tensor` of the training progress.
  """
  num_stages = (2*num_resolutions) - 1
  max_progress = num_blocks - 1

  progress = 0.
  for i in range(1, num_stages, 2):
    this_stage_progress = ((train_time-stage_times[i-1])
                           / (stage_times[i] - stage_times[i-1]))
    this_stage_progress = tf.clip_by_value(this_stage_progress, 0., 1.)
    progress += this_stage_progress
  progress = tf.minimum(progress, max_progress)

  return progress
def compute_progress_from_time ( train_time , num_resolutions , num_blocks , stage_times ) : num_stages = ( 2 * num_resolutions ) - 1 max_progress = num_blocks - 1 progress = 0. for i in range ( 1 , num_stages , 2 ) : this_stage_progress = ( ( train_time - stage_times [ i - 1 ] ) / ( stage_times [ i ] - stage_times [ i - 1 ] ) ) this_stage_progress = tf . clip_by_value ( this_stage_progress , 0. , 1. ) progress += this_stage_progress progress = tf . minimum ( progress , max_progress ) return progress