class_docstr: A stack of Relational Graph Convolutional layers that implement a relational graph
  convolution neural network model as in https://arxiv.org/pdf/1703.06103.pdf
  
  The model minimally requires specification of the layer sizes as a list of int
  corresponding to the feature dimensions for each hidden layer,
  activation functions for each hidden layers, and a generator object.
  
  To use this class as a Keras model, the features and preprocessed adjacency matrix
  should be supplied using the :class:`.RelationalFullBatchNodeGenerator` class.
  The generator object should be instantiated as follows::
  
      generator = RelationalFullBatchNodeGenerator(G)
  
  Note that currently the RGCN class is compatible with both sparse and dense adjacency
  matrices and the :class:`.RelationalFullBatchNodeGenerator` will default to sparse.
  
  Notes:
    - The inputs are tensors with a batch dimension of 1. These are provided by the         :class:`.RelationalFullBatchNodeGenerator` object.
  
    - The nodes provided to the :meth:`.RelationalFullBatchNodeGenerator.flow` method are
      used by the final layer to select the predictions for those nodes in order.
      However, the intermediate layers before the final layer order the nodes
      in the same way as the adjacency matrix.
  
  Examples:
      Creating a RGCN node classification model from an existing :class:`.StellarGraph`
      object ``G``::
  
          generator = RelationalFullBatchNodeGenerator(G)
          rgcn = RGCN(
                  layer_sizes=[32, 4],
                  activations=["elu","softmax"],
                  bases=10,
                  generator=generator,
                  dropout=0.5
              )
          x_inp, predictions = rgcn.in_out_tensors()
  
  .. seealso::
  
     Examples using RGCN:
  
     - `node classification <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/rgcn-node-classification.html>`__
     - `unsupervised representation learning with Deep Graph Infomax <https://stellargraph.readthedocs.io/en/stable/demos/embeddings/deep-graph-infomax-embeddings.html>`__
  
     Appropriate data generator: :class:`.RelationalFullBatchNodeGenerator`.
  
     Related model: :class:`.GCN` is a specialisation for a single edge type.
  
     :class:`.RelationalGraphConvolution` is the base layer out of which an RGCN model is built.
  
  Args:
      layer_sizes (list of int): Output sizes of RGCN layers in the stack.
      generator (RelationalFullBatchNodeGenerator): The generator instance.
      num_bases (int): Specifies number of basis matrices to use for the weight matrices of the RGCN layer
          as in the paper. Defaults to 0 which specifies that no basis decomposition is used.
      bias (bool): If True, a bias vector is learnt for each layer in the RGCN model.
      dropout (float): Dropout rate applied to input features of each RGCN layer.
      activations (list of str or func): Activations applied to each layer's output;
          defaults to ``['relu', ..., 'relu']``.
      kernel_initializer (str or func, optional): The initialiser to use for the weights of each layer.
      kernel_regularizer (str or func, optional): The regulariser to use for the weights of each layer.
      kernel_constraint (str or func, optional): The constraint to use for the weights of each layer.
      bias_initializer (str or func, optional): The initialiser to use for the bias of each layer.
      bias_regularizer (str or func, optionalx): The regulariser to use for the bias of each layer.
      bias_constraint (str or func, optional): The constraint to use for the bias of each layer.
class_docstr_tok: ["A","stack","of","Relational","Graph","Convolutional","layers","that","implement","a","relational","graph","convolution","neural","network","model","as","in","https",":","\/\/arxiv.org\/pdf\/1703.06103.pdf","The","model","minimally","requires","specification","of","the","layer","sizes","as","a","list","of","int","corresponding","to","the","feature","dimensions","for","each","hidden","layer",",","activation","functions","for","each","hidden","layers",",","and","a","generator","object",".","To","use","this","class","as","a","Keras","model",",","the","features","and","preprocessed","adjacency","matrix","should","be","supplied","using","the",":","class",":","`",".RelationalFullBatchNodeGenerator","`","class",".","The","generator","object","should","be","instantiated","as","follows",":",":","generator","=","RelationalFullBatchNodeGenerator","(","G",")","Note","that","currently","the","RGCN","class","is","compatible","with","both","sparse","and","dense","adjacency","matrices","and","the",":","class",":","`",".RelationalFullBatchNodeGenerator","`","will","default","to","sparse",".","Notes",":","-","The","inputs","are","tensors","with","a","batch","dimension","of","1",".","These","are","provided","by","the",":","class",":","`",".RelationalFullBatchNodeGenerator","`","object",".","-","The","nodes","provided","to","the",":","meth",":","`",".RelationalFullBatchNodeGenerator.flow","`","method","are","used","by","the","final","layer","to","select","the","predictions","for","those","nodes","in","order",".","However",",","the","intermediate","layers","before","the","final","layer","order","the","nodes","in","the","same","way","as","the","adjacency","matrix",".","Examples",":","Creating","a","RGCN","node","classification","model","from","an","existing",":","class",":","`",".StellarGraph","`","object","``","G","``",":",":","generator","=","RelationalFullBatchNodeGenerator","(","G",")","rgcn","=","RGCN","(","layer_sizes=","[","32",",","4","]",",","activations=","[","``","elu","''",",","''","softmax","''","]",",","bases=10",",","generator=generator",",","dropout=0.5",")","x_inp",",","predictions","=","rgcn.in_out_tensors","(",")","..","seealso",":",":","Examples","using","RGCN",":","-","`","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/node-classification\/rgcn-node-classification.html",">","`","__","-","`","unsupervised","representation","learning","with","Deep","Graph","Infomax","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/embeddings\/deep-graph-infomax-embeddings.html",">","`","__","Appropriate","data","generator",":",":","class",":","`",".RelationalFullBatchNodeGenerator","`",".","Related","model",":",":","class",":","`",".GCN","`","is","a","specialisation","for","a","single","edge","type",".",":","class",":","`",".RelationalGraphConvolution","`","is","the","base","layer","out","of","which","an","RGCN","model","is","built",".","Args",":","layer_sizes","(","list","of","int",")",":","Output","sizes","of","RGCN","layers","in","the","stack",".","generator","(","RelationalFullBatchNodeGenerator",")",":","The","generator","instance",".","num_bases","(","int",")",":","Specifies","number","of","basis","matrices","to","use","for","the","weight","matrices","of","the","RGCN","layer","as","in","the","paper",".","Defaults","to","0","which","specifies","that","no","basis","decomposition","is","used",".","bias","(","bool",")",":","If","True",",","a","bias","vector","is","learnt","for","each","layer","in","the","RGCN","model",".","dropout","(","float",")",":","Dropout","rate","applied","to","input","features","of","each","RGCN","layer",".","activations","(","list","of","str","or","func",")",":","Activations","applied","to","each","layer","'s","output",";","defaults","to","``","[","'relu","'",",","...",",","'relu","'","]","``",".","kernel_initializer","(","str","or","func",",","optional",")",":","The","initialiser","to","use","for","the","weights","of","each","layer",".","kernel_regularizer","(","str","or","func",",","optional",")",":","The","regulariser","to","use","for","the","weights","of","each","layer",".","kernel_constraint","(","str","or","func",",","optional",")",":","The","constraint","to","use","for","the","weights","of","each","layer",".","bias_initializer","(","str","or","func",",","optional",")",":","The","initialiser","to","use","for","the","bias","of","each","layer",".","bias_regularizer","(","str","or","func",",","optionalx",")",":","The","regulariser","to","use","for","the","bias","of","each","layer",".","bias_constraint","(","str","or","func",",","optional",")",":","The","constraint","to","use","for","the","bias","of","each","layer","."]
docstr: Builds a RGCN model for node prediction. Link/node pair prediction will added in the future.
  
  Returns:
      tuple: ``(x_inp, x_out)``, where ``x_inp`` is a list of Keras input tensors
          for the specified RGCN model and ``x_out`` contains
          model output tensor(s) of shape ``(batch_size, layer_sizes[-1])``
docstr_tok: ["Builds","a","RGCN","model","for","node","prediction",".","Link\/node","pair","prediction","will","added","in","the","future",".","Returns",":","tuple",":","``","(","x_inp",",","x_out",")","``",",","where","``","x_inp","``","is","a","list","of","Keras","input","tensors","for","the","specified","RGCN","model","and","``","x_out","``","contains","model","output","tensor","(","s",")","of","shape","``","(","batch_size",",","layer_sizes","[","-1","]",")","``"]
code: def in_out_tensors(self, multiplicity=None):
      """
      Builds a RGCN model for node prediction. Link/node pair prediction will added in the future.
  
      Returns:
          tuple: ``(x_inp, x_out)``, where ``x_inp`` is a list of Keras input tensors
              for the specified RGCN model and ``x_out`` contains
              model output tensor(s) of shape ``(batch_size, layer_sizes[-1])``
  
      """
      if multiplicity is None:
          multiplicity = self.multiplicity
  
      if multiplicity == 1:
          return self._node_model()
  
      else:
          raise NotImplementedError(
              "Currently only node prediction if supported for RGCN."
          )
  
file_path: stellargraph/stellargraph/layer/rgcn.py
imports: import tensorflow
  from tensorflow.keras import backend
  from tensorflow.keras.layers import Layer, Lambda, Dropout, Input
  from tensorflow.keras import activations, initializers, constraints, regularizers
  from .misc import SqueezedSparseConversion, deprecated_model_function, GatherIndices
  from ..mapper.full_batch_generators import RelationalFullBatchNodeGenerator
label_desc: Use image node_id 4 for calling the RGCN obj's underlying member method code with example usage: obj.in_out_tensors(multiplicity) and returns: self