class_docstr: Entity representations enriched by R-GCN.
  
  The GCN employed by the entity encoder is adapted to include typed edges.
  The forward pass of the GCN is defined by:
  
   .. math::
  
      \textbf{e}_{i}^{l+1} = \sigma \left( \sum_{r \in \mathcal{R}}\sum_{j\in \mathcal{N}_{i}^{r}}
      \frac{1}{c_{i,r}} \textbf{W}_{r}^{l} \textbf{e}_{j}^{l} + \textbf{W}_{0}^{l} \textbf{e}_{i}^{l}\right)
  
  where $\mathcal{N}_{i}^{r}$ is the set of neighbors of node $i$ that are connected to
  $i$ by relation $r$, $c_{i,r}$ is a fixed normalization constant (but it can also be introduced as an additional
  parameter), and $\textbf{W}_{r}^{l} \in \mathbb{R}^{d^{(l)} \times d^{(l)}}$ and
  $\textbf{W}_{0}^{l} \in \mathbb{R}^{d^{(l)} \times d^{(l)}}$ are weight matrices of the `l`-th layer of the
  R-GCN.
  
  The encoder aggregates for each node $e_i$ the latent representations of its neighbors and its
  own latent representation $e_{i}^{l}$ into a new latent representation $e_{i}^{l+1}$.
  In contrast to standard GCN, R-GCN defines relation specific transformations
  $\textbf{W}_{r}^{l}$ which depend on the type and direction of an edge.
  
  Since having one matrix for each relation introduces a large number of additional parameters, the authors instead
  propose to use a decomposition, cf. :class:`pykeen.nn.message_passing.Decomposition`.
  ---
  name: R-GCN
  citation:
      author: Schlichtkrull
      year: 2018
      link: https://arxiv.org/pdf/1703.06103
      github: https://github.com/MichSchli/RelationPrediction
class_docstr_tok: ["Entity","representations","enriched","by","R-GCN",".","The","GCN","employed","by","the","entity","encoder","is","adapted","to","include","typed","edges",".","The","forward","pass","of","the","GCN","is","defined","by",":","..","math",":",":","\\textbf","{","e","}","_","{","i","}","^","{","l+1","}","=","\\sigma","\\left","(","\\sum_","{","r","\\in","\\mathcal","{","R","}","}","\\sum_","{","j\\in","\\mathcal","{","N","}","_","{","i","}","^","{","r","}","}","\\frac","{","1","}","{","c_","{","i",",","r","}","}","\\textbf","{","W","}","_","{","r","}","^","{","l","}","\\textbf","{","e","}","_","{","j","}","^","{","l","}","+","\\textbf","{","W","}","_","{","0","}","^","{","l","}","\\textbf","{","e","}","_","{","i","}","^","{","l","}","\\right",")","where","$","\\mathcal","{","N","}","_","{","i","}","^","{","r","}","$","is","the","set","of","neighbors","of","node","$","i","$","that","are","connected","to","$","i","$","by","relation","$","r","$",",","$","c_","{","i",",","r","}","$","is","a","fixed","normalization","constant","(","but","it","can","also","be","introduced","as","an","additional","parameter",")",",","and","$","\\textbf","{","W","}","_","{","r","}","^","{","l","}","\\in","\\mathbb","{","R","}","^","{","d^","{","(","l",")","}","\\times","d^","{","(","l",")","}","}","$","and","$","\\textbf","{","W","}","_","{","0","}","^","{","l","}","\\in","\\mathbb","{","R","}","^","{","d^","{","(","l",")","}","\\times","d^","{","(","l",")","}","}","$","are","weight","matrices","of","the","`","l","`","-th","layer","of","the","R-GCN",".","The","encoder","aggregates","for","each","node","$","e_i","$","the","latent","representations","of","its","neighbors","and","its","own","latent","representation","$","e_","{","i","}","^","{","l","}","$","into","a","new","latent","representation","$","e_","{","i","}","^","{","l+1","}","$",".","In","contrast","to","standard","GCN",",","R-GCN","defines","relation","specific","transformations","$","\\textbf","{","W","}","_","{","r","}","^","{","l","}","$","which","depend","on","the","type","and","direction","of","an","edge",".","Since","having","one","matrix","for","each","relation","introduces","a","large","number","of","additional","parameters",",","the","authors","instead","propose","to","use","a","decomposition",",","cf",".",":","class",":","`","pykeen.nn.message_passing.Decomposition","`",".","--","-","name",":","R-GCN","citation",":","author",":","Schlichtkrull","year",":","2018","link",":","https",":","\/\/arxiv.org\/pdf\/1703.06103","github",":","https",":","\/\/github.com\/MichSchli\/RelationPrediction"]
code: def post_parameter_update(self) -> None:  # noqa: D102
      super().post_parameter_update()
  
      # invalidate enriched embeddings
      self.enriched_embeddings = None
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Iterable, Mapping, Optional, Sequence
  import torch
  from class_resolver import ClassResolver, Hint, HintOrType, OptionalKwargs
  from class_resolver.contrib.torch import activation_resolver
  from docdata import parse_docdata
  from torch import nn
  from .init import uniform_norm_p1_, xavier_normal_
  from .representation import LowRankRepresentation, Representation
  from .utils import ShapeError, adjacency_tensor_to_stacked_matrix, use_horizontal_stacking
  from .weighting import EdgeWeighting, edge_weight_resolver
  from ..triples import CoreTriplesFactory
  from ..utils import ExtraReprMixin, einsum
label_desc: Use image node_id 2 for calling the RGCNRepresentation obj's underlying member method code with example usage: obj.post_parameter_update() without return types