original_docstring: Visualise results with: tensorboard --logdir=logdir. Now has train/validation curves on the same plot
      
      Parameters:
          checkpoint_dir: Checkpoint of the saved model during training.
          log_dir: Directory to save logs.
          mode: train or validation.
          num_evals: Number of batches to evaluate (mean of the batches is displayed).
      
docstring: Visualise results with: tensorboard --logdir=logdir. Now has train/validation curves on the same plot
docstring_tokens: Visualise results with : tensorboard -- logdir = logdir . Now has train / validation curves on the same plot
code: def evaluate_text_model(checkpoint_dir, log_dir, mode, num_evals):
      """Visualise results with: tensorboard --logdir=logdir. Now has train/validation curves on the same plot
      
      Parameters:
          checkpoint_dir: Checkpoint of the saved model during training.
          log_dir: Directory to save logs.
          mode: train or validation.
          num_evals: Number of batches to evaluate (mean of the batches is displayed).
      """
      with tf.Graph().as_default():
          _CONFIG['mode'] = mode
          model = TextModel(_CONFIG)
  
          # Accuracy metrics
          accuracy = slim.metrics.streaming_accuracy(tf.cast(model.labels, tf.int32),
                                                     tf.cast(tf.argmax(model.logits, 1), tf.int32))
  
          # Choose the metrics to compute:
          names_to_values, names_to_updates = slim.metrics.aggregate_metric_map({
              'accuracy': accuracy,
          })
  
          for metric_name, metric_value in names_to_values.iteritems():
              tf.summary.scalar(metric_name, metric_value)
  
          log_dir = os.path.join(log_dir, mode)
  
          # Evaluate every eval_interval_secs secs or if not specified,
          # every time the checkpoint_dir changes
          # tf.get_variable variables are also restored
          slim.evaluation.evaluation_loop(
              '',
              checkpoint_dir,
              log_dir,
              num_evals=num_evals,
              eval_op=names_to_updates.values())
code_tokens: def evaluate_text_model ( checkpoint_dir , log_dir , mode , num_evals ) : with tf . Graph ( ) . as_default ( ) : _CONFIG [ 'mode' ] = mode model = TextModel ( _CONFIG ) accuracy = slim . metrics . streaming_accuracy ( tf . cast ( model . labels , tf . int32 ) , tf . cast ( tf . argmax ( model . logits , 1 ) , tf . int32 ) ) names_to_values , names_to_updates = slim . metrics . aggregate_metric_map ( { 'accuracy' : accuracy , } ) for metric_name , metric_value in names_to_values . iteritems ( ) : tf . summary . scalar ( metric_name , metric_value ) log_dir = os . path . join ( log_dir , mode ) slim . evaluation . evaluation_loop ( '' , checkpoint_dir , log_dir , num_evals = num_evals , eval_op = names_to_updates . values ( ) )
short_docstring: Visualise results with: tensorboard --logdir=logdir.
short_docstring_tokens: Visualise results with : tensorboard -- logdir = logdir .
comment: """Visualise results with: tensorboard --logdir=logdir. Now has train/validation curves on the same plot
      
      Parameters:
          checkpoint_dir: Checkpoint of the saved model during training.
          log_dir: Directory to save logs.
          mode: train or validation.
          num_evals: Number of batches to evaluate (mean of the batches is displayed).
      """$SEP$# Accuracy metrics$SEP$# Choose the metrics to compute:$SEP$# Evaluate every eval_interval_secs secs or if not specified,$SEP$# every time the checkpoint_dir changes$SEP$# tf.get_variable variables are also restored