class_docstr: A base class for evaluation loops.
class_docstr_tok: ["A","base","class","for","evaluation","loops","."]
docstr: Evaluate the loop's model on the loop's dataset.
  
  .. note::
      the contained model will be set to evaluation mode.
  
  :param batch_size:
      the batch size. If None, enable automatic memory optimization to maximize memory utilization.
  :param use_tqdm:
      whether to use tqdm progress bar
  :param tqdm_kwargs:
      additional keyword-based parameters passed to tqdm
  :param kwargs:
      additional keyword-based parameters passed to :meth:`get_loader`
  
  :return:
      the evaluation results.
code: def evaluate(
      self,
      # batch
      batch_size: Optional[int] = None,
      # tqdm
      use_tqdm: bool = True,
      tqdm_kwargs: OptionalKwargs = None,
      # data loader
      **kwargs,
  ) -> MetricResults:
      """
      Evaluate the loop's model on the loop's dataset.
  
      .. note::
          the contained model will be set to evaluation mode.
  
      :param batch_size:
          the batch size. If None, enable automatic memory optimization to maximize memory utilization.
      :param use_tqdm:
          whether to use tqdm progress bar
      :param tqdm_kwargs:
          additional keyword-based parameters passed to tqdm
      :param kwargs:
          additional keyword-based parameters passed to :meth:`get_loader`
  
      :return:
          the evaluation results.
      """
      # set upper limit of batch size for automatic memory optimization
      if not batch_size:
          if self.model.device.type == "cpu":
              batch_size = 32
          else:
              batch_size = len(self.dataset)
      # set model to evaluation mode
      self.model.eval()
      # delegate to AMO wrapper
      return _evaluate(
          loop=self,
          batch_size=batch_size,
          use_tqdm=use_tqdm,
          tqdm_kwargs=tqdm_kwargs,
          **kwargs,
      )
  
imports: import dataclasses
  import logging
  from abc import abstractmethod
  from collections import defaultdict
  from typing import Any, Collection, DefaultDict, Generic, Iterable, List, Mapping, Optional, Tuple, TypeVar, Union, cast
  import numpy
  import pandas
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils.data import Dataset
  from torch.utils.data.dataloader import DataLoader
  from torch_max_mem import maximize_memory_utilization
  from tqdm.auto import tqdm
  from typing_extensions import TypeAlias
  from .evaluator import Evaluator, MetricResults, filter_scores_
  from ..constants import COLUMN_LABELS, TARGET_TO_INDEX
  from ..models import Model
  from ..triples import CoreTriplesFactory, get_mapped_triples
  from ..typing import LABEL_HEAD, LABEL_TAIL, InductiveMode, MappedTriples, OneOrSequence, Target
  from ..utils import upgrade_to_sequence
label_desc: Use image node_id 5 for calling the EvaluationLoop obj's underlying member method code with example usage: obj.evaluate(batch_size, use_tqdm, tqdm_kwargs) and returns: _evaluate