class_docstr: A base module for KGE models.
  
  Subclasses of :class:`Model` can decide however they want on how to store entities' and
  relations' representations, how they want to be looked up, and how they should
  be scored. The :class:`OModel` provides a commonly used interface for models storing entity
  and relation representations in the form of :class:`pykeen.nn.Embedding`.
class_docstr_tok: ["A","base","module","for","KGE","models",".","Subclasses","of",":","class",":","`","Model","`","can","decide","however","they","want","on","how","to","store","entities","'","and","relations","'","representations",",","how","they","want","to","be","looked","up",",","and","how","they","should","be","scored",".","The",":","class",":","`","OModel","`","provides","a","commonly","used","interface","for","models","storing","entity","and","relation","representations","in","the","form","of",":","class",":","`","pykeen.nn.Embedding","`","."]
docstr: Predict scores for the given target.
  
  :param hrt_batch: shape: (batch_size, 3) or (batch_size, 2)
      the full batch, or the relevant part of it
  :param target:
      the target to predict
  :param full_batch:
      whether `hrt_batch` is the full batch, or only the "input" part of the target prediction method
  :param ids:
      restrict prediction to only those ids
  :param kwargs:
      additional keyword-based parameters passed to the specific target prediction method.
  
  :raises ValueError:
      if the target is invalid
  
  :return: shape: (batch_size, num)
      the scores
docstr_tok: ["Predict","scores","for","the","given","target",".",":","param","hrt_batch",":","shape",":","(","batch_size",",","3",")","or","(","batch_size",",","2",")","the","full","batch",",","or","the","relevant","part","of","it",":","param","target",":","the","target","to","predict",":","param","full_batch",":","whether","`","hrt_batch","`","is","the","full","batch",",","or","only","the","``","input","''","part","of","the","target","prediction","method",":","param","ids",":","restrict","prediction","to","only","those","ids",":","param","kwargs",":","additional","keyword-based","parameters","passed","to","the","specific","target","prediction","method",".",":","raises","ValueError",":","if","the","target","is","invalid",":","return",":","shape",":","(","batch_size",",","num",")","the","scores"]
code: def predict(
      self,
      hrt_batch: MappedTriples,
      target: Target,
      full_batch: bool = True,
      ids: Optional[torch.LongTensor] = None,
      **kwargs,
  ) -> torch.FloatTensor:
      """
      Predict scores for the given target.
  
      :param hrt_batch: shape: (batch_size, 3) or (batch_size, 2)
          the full batch, or the relevant part of it
      :param target:
          the target to predict
      :param full_batch:
          whether `hrt_batch` is the full batch, or only the "input" part of the target prediction method
      :param ids:
          restrict prediction to only those ids
      :param kwargs:
          additional keyword-based parameters passed to the specific target prediction method.
  
      :raises ValueError:
          if the target is invalid
  
      :return: shape: (batch_size, num)
          the scores
      """
      if target == LABEL_TAIL:
          if full_batch:
              hrt_batch = hrt_batch[:, 0:2]
          return self.predict_t(hrt_batch, **kwargs, tails=ids)
  
      if target == LABEL_RELATION:
          if full_batch:
              hrt_batch = hrt_batch[:, 0::2]
          return self.predict_r(hrt_batch, **kwargs, relations=ids)
  
      if target == LABEL_HEAD:
          if full_batch:
              hrt_batch = hrt_batch[:, 1:3]
          return self.predict_h(hrt_batch, **kwargs, heads=ids)
  
      raise ValueError(f"Unknown target={target}")
  
imports: from __future__ import annotations
  import inspect
  import logging
  import os
  import pickle
  from abc import ABC, abstractmethod
  from typing import Any, ClassVar, Iterable, Mapping, Optional, Type, Union
  import torch
  from class_resolver import HintOrType
  from docdata import parse_docdata
  from torch import nn
  from ..inverse import RelationInverter, relation_inverter_resolver
  from ..losses import Loss, MarginRankingLoss, loss_resolver
  from ..triples import KGInfo
  from ..typing import LABEL_HEAD, LABEL_RELATION, LABEL_TAIL, InductiveMode, MappedTriples, Target
  from ..utils import NoRandomSeedNecessary, get_preferred_device, set_random_seed
label_desc: Use image node_id 26 for calling the Model obj's underlying member method code with example usage: obj.predict(hrt_batch, target, full_batch, ids) and returns: self, self, self