docstr: Evaluation function. The function reports the evaluation metrics used for monitoring the training loop.
  
  Parameters
  ----------
  testloader
      Test dataloader.
  
  Returns
  -------
  Evaluation metrics.
docstr_tok: ["Evaluation","function",".","The","function","reports","the","evaluation","metrics","used","for","monitoring","the","training","loop",".","Parameters","--","--","--","--","--","testloader","Test","dataloader",".","Returns","--","--","--","-","Evaluation","metrics","."]
code: def evaluate(self, testloader: DataLoader) -> Dict[str, float]:
      """
      Evaluation function. The function reports the evaluation metrics used for monitoring the training loop.
  
      Parameters
      ----------
      testloader
          Test dataloader.
  
      Returns
      -------
      Evaluation metrics.
      """
      self._reset_loss()
      self._reset_metrics()
  
      # perform test steps in batches
      for data in tqdm(testloader):
          if len(data) < 2:
              raise ValueError(
                  "An input and at least a label should be provided."
              )
  
          x = data[0]
          y = data[1] if len(data) == 2 else data[1:]
          metrics_vals = self.test_step(x, y)
  
      # log losses
      print(Model._metrics_to_str(metrics_vals))
      return metrics_vals
  
imports: import torch
  import torch.nn
  import torch.optim
  from torch.utils.data import DataLoader
  from tqdm import tqdm
  from typing import List, Dict, Callable, Union, Tuple, Optional
  from alibi.models.pytorch.metrics import Metric, LossContainer
label_desc: Use image node_id 9 for calling the Model obj's underlying member method code with example usage: obj.evaluate(testloader) and returns: metrics_vals