parameters: (self)
docstring: Repeatedly calls `Estimator` evaluate and export until training ends.
docstring_summary: Repeatedly calls `Estimator` evaluate and export until training ends.
docstring_tokens: Repeatedly calls Estimator evaluate and export until training ends .
function: def _start_continuous_evaluation(self):
      """Repeatedly calls `Estimator` evaluate and export until training ends."""
      start_delay_secs = self._eval_spec.start_delay_secs
      if start_delay_secs:
        logging.info('Waiting %f secs before starting eval.', start_delay_secs)
        time.sleep(start_delay_secs)
  
      latest_eval_result = None
      evaluator = _TrainingExecutor._Evaluator(self._estimator, self._eval_spec,
                                               self._train_spec.max_steps)
  
      while True:
        if latest_eval_result:
          global_step = latest_eval_result.get(ops.GraphKeys.GLOBAL_STEP)
          if (global_step and self._train_spec.max_steps and
              global_step >= self._train_spec.max_steps):
            logging.info(
                'Exiting evaluation, global_step=%s >= train max_steps=%s',
                global_step,
                self._train_spec.max_steps)
            return
  
        # Final export signal: For any eval result with global_step >= train
        # max_steps, the evaluator will send the final export signal. The next
        # iteration of while loop will end the continuous eval as the stopping
        # condition is satisfied (both checks use the same global_step value,
        # i.e., no race condition)
        start = time.time()
        latest_eval_result = evaluator.evaluate_and_export()
  
        # Throttle if necessary.
        elapsed_time = time.time() - start
        difference = self._eval_spec.throttle_secs  - elapsed_time
        if difference > 0:
          logging.info('Waiting %f secs before starting next eval run.',
                       difference)
          time.sleep(difference)
function_tokens: def _start_continuous_evaluation ( self ) : start_delay_secs = self . _eval_spec . start_delay_secs if start_delay_secs : logging . info ( 'Waiting %f secs before starting eval.' , start_delay_secs ) time . sleep ( start_delay_secs ) latest_eval_result = None evaluator = _TrainingExecutor . _Evaluator ( self . _estimator , self . _eval_spec , self . _train_spec . max_steps ) while True : if latest_eval_result : global_step = latest_eval_result . get ( ops . GraphKeys . GLOBAL_STEP ) if ( global_step and self . _train_spec . max_steps and global_step >= self . _train_spec . max_steps ) : logging . info ( 'Exiting evaluation, global_step=%s >= train max_steps=%s' , global_step , self . _train_spec . max_steps ) return # Final export signal: For any eval result with global_step >= train # max_steps, the evaluator will send the final export signal. The next # iteration of while loop will end the continuous eval as the stopping # condition is satisfied (both checks use the same global_step value, # i.e., no race condition) start = time . time ( ) latest_eval_result = evaluator . evaluate_and_export ( ) # Throttle if necessary. elapsed_time = time . time ( ) - start difference = self . _eval_spec . throttle_secs - elapsed_time if difference > 0 : logging . info ( 'Waiting %f secs before starting next eval run.' , difference ) time . sleep ( difference )