class_docstr: Wraps the function `feature_steered_convolution` as a Keras layer.
class_docstr_tok: ["Wraps","the","function","`","feature_steered_convolution","`","as","a","Keras","layer","."]
docstr: Executes the convolution.
  
  The shorthands used below are
    `V`: The number of vertices.
    `C`: The number of channels in the input data.
  
  Note:
    In the following, A1 to An are optional batch dimensions.
  
  Args:
    inputs: A list of two tensors `[data, neighbors]`. `data` is a `float`
      tensor with shape `[A1, ..., An, V, C]`. `neighbors` is a `SparseTensor`
      with the same type as `data` and with shape `[A1, ..., An, V, V]`
      representing vertex neighborhoods. The neighborhood of a vertex defines
      the support region for convolution. For a mesh, a common choice for the
      neighborhood of vertex `i` would be the vertices in the K-ring of `i`
      (including `i` itself). Each vertex must have at least one neighbor. For
      a faithful implementation of the FeaStNet paper, neighbors should be a
      row-normalized weight matrix corresponding to the graph adjacency matrix
      with self-edges: `neighbors[A1, ..., An, i, j] > 0` if vertex `j` is a
      neighbor of vertex `i`, and `neighbors[A1, ..., An, i, i] > 0` for all
      `i`, and `sum(neighbors, axis=-1)[A1, ..., An, i] == 1.0` for all `i`.
      These requirements are relaxed in this implementation.
    **kwargs: A dictionary containing the key `sizes`, which is an `int` tensor
      of shape `[A1, ..., An]` indicating the true input sizes in case of
      padding (`sizes=None` indicates no padding). `sizes[A1, ..., An] <= V`.
      If `data` and `neighbors` are 2-D, `sizes` will be ignored. As an
      example usage of `sizes`, consider an input consisting of three graphs
      `G0`, `G1`, and `G2` with `V0`, `V1`, and `V2` vertices respectively.
      The padded input would have the shapes `data.shape = [3, V, C]`, and
      `neighbors.shape = [3, V, V]`, where `V = max([V0, V1, V2])`. The true
      sizes of each graph will be specified by `sizes=[V0, V1, V2]`.
      `data[i, :Vi, :]` and `neighbors[i, :Vi, :Vi]` will be the vertex and
      neighborhood data of graph `Gi`. The `SparseTensor` `neighbors` should
      have no nonzero entries in the padded regions.
  
  Returns:
    Tensor with shape `[A1, ..., An, V, num_output_channels]`.
docstr_tok: ["Executes","the","convolution",".","The","shorthands","used","below","are","`","V","`",":","The","number","of","vertices",".","`","C","`",":","The","number","of","channels","in","the","input","data",".","Note",":","In","the","following",",","A1","to","An","are","optional","batch","dimensions",".","Args",":","inputs",":","A","list","of","two","tensors","`","[","data",",","neighbors","]","`",".","`","data","`","is","a","`","float","`","tensor","with","shape","`","[","A1",",","...",",","An",",","V",",","C","]","`",".","`","neighbors","`","is","a","`","SparseTensor","`","with","the","same","type","as","`","data","`","and","with","shape","`","[","A1",",","...",",","An",",","V",",","V","]","`","representing","vertex","neighborhoods",".","The","neighborhood","of","a","vertex","defines","the","support","region","for","convolution",".","For","a","mesh",",","a","common","choice","for","the","neighborhood","of","vertex","`","i","`","would","be","the","vertices","in","the","K-ring","of","`","i","`","(","including","`","i","`","itself",")",".","Each","vertex","must","have","at","least","one","neighbor",".","For","a","faithful","implementation","of","the","FeaStNet","paper",",","neighbors","should","be","a","row-normalized","weight","matrix","corresponding","to","the","graph","adjacency","matrix","with","self-edges",":","`","neighbors","[","A1",",","...",",","An",",","i",",","j","]",">","0","`","if","vertex","`","j","`","is","a","neighbor","of","vertex","`","i","`",",","and","`","neighbors","[","A1",",","...",",","An",",","i",",","i","]",">","0","`","for","all","`","i","`",",","and","`","sum","(","neighbors",",","axis=-1",")","[","A1",",","...",",","An",",","i","]","==","1.0","`","for","all","`","i","`",".","These","requirements","are","relaxed","in","this","implementation",".","*","*","kwargs",":","A","dictionary","containing","the","key","`","sizes","`",",","which","is","an","`","int","`","tensor","of","shape","`","[","A1",",","...",",","An","]","`","indicating","the","true","input","sizes","in","case","of","padding","(","`","sizes=None","`","indicates","no","padding",")",".","`","sizes","[","A1",",","...",",","An","]","<","=","V","`",".","If","`","data","`","and","`","neighbors","`","are","2-D",",","`","sizes","`","will","be","ignored",".","As","an","example","usage","of","`","sizes","`",",","consider","an","input","consisting","of","three","graphs","`","G0","`",",","`","G1","`",",","and","`","G2","`","with","`","V0","`",",","`","V1","`",",","and","`","V2","`","vertices","respectively",".","The","padded","input","would","have","the","shapes","`","data.shape","=","[","3",",","V",",","C","]","`",",","and","`","neighbors.shape","=","[","3",",","V",",","V","]","`",",","where","`","V","=","max","(","[","V0",",","V1",",","V2","]",")","`",".","The","true","sizes","of","each","graph","will","be","specified","by","`","sizes=","[","V0",",","V1",",","V2","]","`",".","`","data","[","i",",",":","Vi",",",":","]","`","and","`","neighbors","[","i",",",":","Vi",",",":","Vi","]","`","will","be","the","vertex","and","neighborhood","data","of","graph","`","Gi","`",".","The","`","SparseTensor","`","`","neighbors","`","should","have","no","nonzero","entries","in","the","padded","regions",".","Returns",":","Tensor","with","shape","`","[","A1",",","...",",","An",",","V",",","num_output_channels","]","`","."]
code: def call(self, inputs, **kwargs):
      # pyformat: disable
      """Executes the convolution.
  
      The shorthands used below are
        `V`: The number of vertices.
        `C`: The number of channels in the input data.
  
      Note:
        In the following, A1 to An are optional batch dimensions.
  
      Args:
        inputs: A list of two tensors `[data, neighbors]`. `data` is a `float`
          tensor with shape `[A1, ..., An, V, C]`. `neighbors` is a `SparseTensor`
          with the same type as `data` and with shape `[A1, ..., An, V, V]`
          representing vertex neighborhoods. The neighborhood of a vertex defines
          the support region for convolution. For a mesh, a common choice for the
          neighborhood of vertex `i` would be the vertices in the K-ring of `i`
          (including `i` itself). Each vertex must have at least one neighbor. For
          a faithful implementation of the FeaStNet paper, neighbors should be a
          row-normalized weight matrix corresponding to the graph adjacency matrix
          with self-edges: `neighbors[A1, ..., An, i, j] > 0` if vertex `j` is a
          neighbor of vertex `i`, and `neighbors[A1, ..., An, i, i] > 0` for all
          `i`, and `sum(neighbors, axis=-1)[A1, ..., An, i] == 1.0` for all `i`.
          These requirements are relaxed in this implementation.
        **kwargs: A dictionary containing the key `sizes`, which is an `int` tensor
          of shape `[A1, ..., An]` indicating the true input sizes in case of
          padding (`sizes=None` indicates no padding). `sizes[A1, ..., An] <= V`.
          If `data` and `neighbors` are 2-D, `sizes` will be ignored. As an
          example usage of `sizes`, consider an input consisting of three graphs
          `G0`, `G1`, and `G2` with `V0`, `V1`, and `V2` vertices respectively.
          The padded input would have the shapes `data.shape = [3, V, C]`, and
          `neighbors.shape = [3, V, V]`, where `V = max([V0, V1, V2])`. The true
          sizes of each graph will be specified by `sizes=[V0, V1, V2]`.
          `data[i, :Vi, :]` and `neighbors[i, :Vi, :Vi]` will be the vertex and
          neighborhood data of graph `Gi`. The `SparseTensor` `neighbors` should
          have no nonzero entries in the padded regions.
  
      Returns:
        Tensor with shape `[A1, ..., An, V, num_output_channels]`.
      """
  
      # pyformat: enable
      sizes = kwargs.get("sizes", None)
      return gc.feature_steered_convolution(
          data=inputs[0],
          neighbors=inputs[1],
          sizes=sizes,
          var_u=self.var_u,
          var_v=self.var_v,
          var_c=self.var_c,
          var_w=self.var_w,
          var_b=self.var_b,
      )
  
file_path: graphics/tensorflow_graphics/nn/layer/graph_convolution.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  import tensorflow_graphics.geometry.convolution.graph_convolution
  from tensorflow_graphics.util import export_api
label_desc: Use image node_id 3 for calling the FeatureSteeredConvolutionKerasLayer obj's underlying member method code with example usage: obj.call(inputs) and returns: gc