class_docstr: Implementation of Approximate Personalized Propagation of Neural Predictions (APPNP)
  as in https://arxiv.org/abs/1810.05997.
  
  The model minimally requires specification of the fully connected 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:`.FullBatchNodeGenerator` class for node inference
  - the :class:`.ClusterNodeGenerator` class for scalable/inductive node inference using the Cluster-GCN training procedure (https://arxiv.org/abs/1905.07953)
  - the :class:`.FullBatchLinkGenerator` class for link inference
  
  To have the appropriate preprocessing the generator object should be instantiated
  with the `method='gcn'` argument.
  
  Example:
      Building an APPNP node model::
  
          generator = FullBatchNodeGenerator(G, method="gcn")
          ppnp = APPNP(
              layer_sizes=[64, 64, 1],
              activations=['relu', 'relu', 'relu'],
              generator=generator,
              dropout=0.5
          )
          x_in, x_out = ppnp.in_out_tensors()
  
  Notes:
    - The inputs are tensors with a batch dimension of 1. These are provided by the         :class:`.FullBatchNodeGenerator` object.
  
    - This assumes that the normalized Laplacian matrix is provided as input to
      Keras methods. When using the :class:`.FullBatchNodeGenerator` specify the
      ``method='gcn'`` argument to do this preprocessing.
  
    - The nodes provided to the :meth:`.FullBatchNodeGenerator.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.
  
    - The size of the final fully connected layer must be equal to the number of classes to predict.
  
  .. seealso::
  
     Example using APPNP: `node classification <https://stellargraph.readthedocs.io/en/stable/demos/node-classification/ppnp-node-classification.html>`__.
  
     Appropriate data generators: :class:`.FullBatchNodeGenerator`, :class:`.FullBatchLinkGenerator`, :class:`.ClusterNodeGenerator`.
  
     :class:`.APPNPPropagationLayer` is the base layer out of which an APPNP model is built.
  
  Args:
      layer_sizes (list of int): list of output sizes of fully connected layers in the stack
      activations (list of str): list of activations applied to each fully connected layer's output
      generator (FullBatchNodeGenerator): an instance of FullBatchNodeGenerator class constructed on the graph of interest
      bias (bool): toggles an optional bias in fully connected layers
      dropout (float): dropout rate applied to input features of each layer
      kernel_regularizer (str): normalization applied to the kernels of fully connected layers
      teleport_probability: "probability" of returning to the starting node in the propagation step as described in
      the paper (alpha in the paper)
      approx_iter: number of iterations to approximate PPNP as described in the paper (K in the paper)
class_docstr_tok: ["Implementation","of","Approximate","Personalized","Propagation","of","Neural","Predictions","(","APPNP",")","as","in","https",":","\/\/arxiv.org\/abs\/1810.05997",".","The","model","minimally","requires","specification","of","the","fully","connected","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",":","`",".FullBatchNodeGenerator","`","class","for","node","inference","-","the",":","class",":","`",".ClusterNodeGenerator","`","class","for","scalable\/inductive","node","inference","using","the","Cluster-GCN","training","procedure","(","https",":","\/\/arxiv.org\/abs\/1905.07953",")","-","the",":","class",":","`",".FullBatchLinkGenerator","`","class","for","link","inference","To","have","the","appropriate","preprocessing","the","generator","object","should","be","instantiated","with","the","`","method='gcn","'","`","argument",".","Example",":","Building","an","APPNP","node","model",":",":","generator","=","FullBatchNodeGenerator","(","G",",","method=","''","gcn","''",")","ppnp","=","APPNP","(","layer_sizes=","[","64",",","64",",","1","]",",","activations=","[","'relu","'",",","'relu","'",",","'relu","'","]",",","generator=generator",",","dropout=0.5",")","x_in",",","x_out","=","ppnp.in_out_tensors","(",")","Notes",":","-","The","inputs","are","tensors","with","a","batch","dimension","of","1",".","These","are","provided","by","the",":","class",":","`",".FullBatchNodeGenerator","`","object",".","-","This","assumes","that","the","normalized","Laplacian","matrix","is","provided","as","input","to","Keras","methods",".","When","using","the",":","class",":","`",".FullBatchNodeGenerator","`","specify","the","``","method='gcn","'","``","argument","to","do","this","preprocessing",".","-","The","nodes","provided","to","the",":","meth",":","`",".FullBatchNodeGenerator.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",".","-","The","size","of","the","final","fully","connected","layer","must","be","equal","to","the","number","of","classes","to","predict",".","..","seealso",":",":","Example","using","APPNP",":","`","node","classification","<","https",":","\/\/stellargraph.readthedocs.io\/en\/stable\/demos\/node-classification\/ppnp-node-classification.html",">","`","__",".","Appropriate","data","generators",":",":","class",":","`",".FullBatchNodeGenerator","`",",",":","class",":","`",".FullBatchLinkGenerator","`",",",":","class",":","`",".ClusterNodeGenerator","`",".",":","class",":","`",".APPNPPropagationLayer","`","is","the","base","layer","out","of","which","an","APPNP","model","is","built",".","Args",":","layer_sizes","(","list","of","int",")",":","list","of","output","sizes","of","fully","connected","layers","in","the","stack","activations","(","list","of","str",")",":","list","of","activations","applied","to","each","fully","connected","layer","'s","output","generator","(","FullBatchNodeGenerator",")",":","an","instance","of","FullBatchNodeGenerator","class","constructed","on","the","graph","of","interest","bias","(","bool",")",":","toggles","an","optional","bias","in","fully","connected","layers","dropout","(","float",")",":","dropout","rate","applied","to","input","features","of","each","layer","kernel_regularizer","(","str",")",":","normalization","applied","to","the","kernels","of","fully","connected","layers","teleport_probability",":","``","probability","''","of","returning","to","the","starting","node","in","the","propagation","step","as","described","in","the","paper","(","alpha","in","the","paper",")","approx_iter",":","number","of","iterations","to","approximate","PPNP","as","described","in","the","paper","(","K","in","the","paper",")"]
docstr: Builds an APPNP model for node or link prediction
  
  Returns:
      tuple: ``(x_inp, x_out)``, where ``x_inp`` is a list of Keras/TensorFlow
          input tensors for the model and ``x_out`` is a tensor of the model output.
docstr_tok: ["Builds","an","APPNP","model","for","node","or","link","prediction","Returns",":","tuple",":","``","(","x_inp",",","x_out",")","``",",","where","``","x_inp","``","is","a","list","of","Keras\/TensorFlow","input","tensors","for","the","model","and","``","x_out","``","is","a","tensor","of","the","model","output","."]
code: def in_out_tensors(self, multiplicity=None):
      """
      Builds an APPNP model for node or link prediction
  
      Returns:
          tuple: ``(x_inp, x_out)``, where ``x_inp`` is a list of Keras/TensorFlow
              input tensors for the model and ``x_out`` is a tensor of the model output.
      """
      x_inp, x_out = self._tensors(
          multiplicity=multiplicity, feature_layers=self._feature_layers
      )
      # Flatten output by removing singleton batch dimension
      if x_out.shape[0] == 1:
          self.x_out_flat = Lambda(lambda x: K.squeeze(x, 0))(x_out)
      else:
          self.x_out_flat = x_out
  
      return x_inp, x_out
  
imports: import warnings
  from tensorflow.keras.layers import Dense, Lambda, Dropout, Input, Layer, InputLayer
  import tensorflow.keras.backend
  from ..mapper import FullBatchGenerator, ClusterNodeGenerator
  from .preprocessing_layer import GraphPreProcessingLayer
  from .misc import SqueezedSparseConversion, deprecated_model_function, GatherIndices
label_desc: Use image node_id 5 for calling the APPNP obj's underlying member method code with example usage: obj.in_out_tensors(multiplicity) and returns: x_inp,  x_out