class_docstr: An abstract class for knowledge graph embedding models (KGEMs).
  
  The only function that needs to be implemented for a given subclass is
  :meth:`Model.forward`. The job of the :meth:`Model.forward` function, as
  opposed to the completely general :meth:`torch.nn.Module.forward` is
  to take indices for the head, relation, and tails' respective representation(s)
  and to determine a score.
  
  Subclasses of 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:`ERModel` provides a commonly useful implementation
  which allows for the specification of one or more entity representations and
  one or more relation representations in the form of :class:`pykeen.nn.Embedding`
  as well as a matching instance of a :class:`pykeen.nn.Interaction`.
docstr: Reset all parameters of the model in-place.
docstr_tok: ["Reset","all","parameters","of","the","model","in-place","."]
code: def _reset_parameters_(self):  # noqa: D401
      """Reset all parameters of the model in-place."""
      # cf. https://github.com/mberr/ea-sota-comparison/blob/6debd076f93a329753d819ff4d01567a23053720/src/kgm/utils/torch_utils.py#L317-L372   # noqa:E501
      # Make sure that all modules with parameters do have a reset_parameters method.
      uninitialized_parameters = set(map(id, self.parameters()))
      parents = defaultdict(list)
  
      # Recursively visit all sub-modules
      task_list = []
      for name, module in self.named_modules():
          # skip self
          if module is self:
              continue
  
          # Track parents for blaming
          for p in module.parameters():
              parents[id(p)].append(module)
  
          # call reset_parameters if possible
          if hasattr(module, "reset_parameters"):
              task_list.append((name.count("."), module))
  
      # initialize from bottom to top
      # This ensures that specialized initializations will take priority over the default ones of its components.
      for module in map(
          itemgetter(1),
          sorted(task_list, reverse=True, key=itemgetter(0)),
      ):
          module.reset_parameters()
          uninitialized_parameters.difference_update(
              map(id, module.parameters())
          )
  
      # emit warning if there where parameters which were not initialised by reset_parameters.
      if len(uninitialized_parameters) > 0:
          logger.warning(
              "reset_parameters() not found for all modules containing parameters. "
              "%d parameters where likely not initialized.",
              len(uninitialized_parameters),
          )
  
          # Additional debug information
          for i, p_id in enumerate(uninitialized_parameters, start=1):
              logger.debug(
                  "[%3d] Parents to blame: %s", i, parents.get(p_id)
              )
  
imports: from __future__ import annotations
  import logging
  from abc import ABC
  from collections import defaultdict
  from operator import itemgetter
  from typing import Any, ClassVar, Generic, Iterable, List, Literal, Mapping, Optional, Sequence, Tuple, Type, Union, cast
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from class_resolver.utils import OneOrManyHintOrType, OneOrManyOptionalKwargs, normalize_with_default
  from torch import nn
  from .base import Model
  from ..nn import representation_resolver
  from ..nn.modules import Interaction, interaction_resolver, parallel_unsqueeze
  from ..nn.representation import Representation
  from ..regularizers import Regularizer, regularizer_resolver
  from ..triples import KGInfo
  from ..typing import HeadRepresentation, InductiveMode, RelationRepresentation, TailRepresentation
  from ..utils import check_shapes, get_batchnorm_modules
label_desc: Use image node_id 1 for calling the _NewAbstractModel obj's underlying member method code with example usage: obj._reset_parameters_() without return types