class_docstr: A sampled, rank-based evaluator that applies a custom OGB evaluation.
class_docstr_tok: ["A","sampled",",","rank-based","evaluator","that","applies","a","custom","OGB","evaluation","."]
docstr: Run :func:`evaluate_ogb` with this evaluator.
docstr_tok: ["Run",":","func",":","`","evaluate_ogb","`","with","this","evaluator","."]
code: def evaluate(
      self,
      model: Model,
      mapped_triples: MappedTriples,
      batch_size: Optional[int] = None,
      slice_size: Optional[int] = None,
      device: Optional[torch.device] = None,
      use_tqdm: bool = True,
      tqdm_kwargs: Optional[Mapping[str, str]] = None,
      restrict_entities_to: Optional[Collection[int]] = None,
      restrict_relations_to: Optional[Collection[int]] = None,
      do_time_consuming_checks: bool = True,
      additional_filter_triples: Union[
          None, MappedTriples, List[MappedTriples]
      ] = None,
      pre_filtered_triples: bool = True,
      targets: Collection[Target] = (LABEL_HEAD, LABEL_TAIL),
  ) -> MetricResults:
      """Run :func:`evaluate_ogb` with this evaluator."""
      if (
          {
              restrict_relations_to,
              restrict_entities_to,
              additional_filter_triples,
          }
          != {None}
          or do_time_consuming_checks is False
          or pre_filtered_triples is False
      ):
          raise ValueError(
              f"{self} does not support any of {{restrict_relations_to, restrict_entities_to, "
              f"additional_filter_triples, do_time_consuming_checks, pre_filtered_triples}}",
          )
      return evaluate_ogb(
          evaluator=self,
          model=model,
          mapped_triples=mapped_triples,
          batch_size=batch_size,
          slice_size=slice_size,
          use_tqdm=use_tqdm,
          tqdm_kwargs=tqdm_kwargs,
          targets=targets,
      )
  
file_path: pykeen/src/pykeen/evaluation/ogb_evaluator.py
imports: from __future__ import annotations
  import logging
  from typing import Any, Collection, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import torch
  from torch_max_mem import maximize_memory_utilization
  from tqdm.auto import tqdm
  from .evaluator import MetricResults
  from .rank_based_evaluator import RankBasedMetricKey, RankBasedMetricResults, SampledRankBasedEvaluator
  from ..metrics import RankBasedMetric
  from ..metrics.ranking import HitsAtK, InverseHarmonicMeanRank
  from ..models import Model
  from ..typing import LABEL_HEAD, LABEL_TAIL, RANK_REALISTIC, SIDE_BOTH, ExtendedTarget, MappedTriples, Target
label_desc: Use image node_id 2 for calling the OGBEvaluator obj's underlying member method code with example usage: obj.evaluate(model, mapped_triples, batch_size, slice_size, device, use_tqdm, tqdm_kwargs, restrict_entities_to, restrict_relations_to, do_time_consuming_checks, additional_filter_triples, pre_filtered_triples, targets) and returns: evaluate_ogb