class_docstr:   A diffusion convolution operator from the paper
  
    > [Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic
  Forecasting](https://arxiv.org/abs/1707.01926)<br>
    > Yaguang Li et al.
  
    **Mode**: single, disjoint, mixed, batch.
  
    **This layer expects a dense adjacency matrix.**
  
    Given a number of diffusion steps \(K\) and a row-normalized adjacency
    matrix \(\hat \A \), this layer calculates the \(q\)-th channel as:
    $$
    \mathbf{X}_{~:,~q}' = \sigma\left( \sum_{f=1}^{F} \left( \sum_{k=0}^{K-1}
    \theta_k {\hat \A}^k \right) \X_{~:,~f} \right)
    $$
  
    **Input**
  
    - Node features of shape `([batch], n_nodes, n_node_features)`;
    - Normalized adjacency or attention coef. matrix \(\hat \A \) of shape
    `([batch], n_nodes, n_nodes)`; Use `DiffusionConvolution.preprocess` to normalize.
  
    **Output**
  
    - Node features with the same shape as the input, but with the last
    dimension changed to `channels`.
  
    **Arguments**
  
    - `channels`: number of output channels;
    - `K`: number of diffusion steps.
    - `activation`: activation function \(\sigma\); (\(\tanh\) by default)
    - `kernel_initializer`: initializer for the weights;
    - `kernel_regularizer`: regularization applied to the weights;
    - `kernel_constraint`: constraint applied to the weights;
class_docstr_tok: ["A","diffusion","convolution","operator","from","the","paper",">","[","Diffusion","Convolutional","Recurrent","Neural","Network",":","Data-Driven","Traffic","Forecasting","]","(","https",":","\/\/arxiv.org\/abs\/1707.01926",")","<","br",">",">","Yaguang","Li","et","al",".","*","*","Mode","*","*",":","single",",","disjoint",",","mixed",",","batch",".","*","*","This","layer","expects","a","dense","adjacency","matrix",".","*","*","Given","a","number","of","diffusion","steps","\\","(","K\\",")","and","a","row-normalized","adjacency","matrix","\\","(","\\hat","\\A","\\",")",",","this","layer","calculates","the","\\","(","q\\",")","-th","channel","as",":","$","$","\\mathbf","{","X","}","_","{","~",":",",~q","}","'","=","\\sigma\\left","(","\\sum_","{","f=1","}","^","{","F","}","\\left","(","\\sum_","{","k=0","}","^","{","K-1","}","\\theta_k","{","\\hat","\\A","}","^k","\\right",")","\\X_","{","~",":",",~f","}","\\right",")","$","$","*","*","Input","*","*","-","Node","features","of","shape","`","(","[","batch","]",",","n_nodes",",","n_node_features",")","`",";","-","Normalized","adjacency","or","attention","coef",".","matrix","\\","(","\\hat","\\A","\\",")","of","shape","`","(","[","batch","]",",","n_nodes",",","n_nodes",")","`",";","Use","`","DiffusionConvolution.preprocess","`","to","normalize",".","*","*","Output","*","*","-","Node","features","with","the","same","shape","as","the","input",",","but","with","the","last","dimension","changed","to","`","channels","`",".","*","*","Arguments","*","*","-","`","channels","`",":","number","of","output","channels",";","-","`","K","`",":","number","of","diffusion","steps",".","-","`","activation","`",":","activation","function","\\","(","\\sigma\\",")",";","(","\\","(","\\tanh\\",")","by","default",")","-","`","kernel_initializer","`",":","initializer","for","the","weights",";","-","`","kernel_regularizer","`",":","regularization","applied","to","the","weights",";","-","`","kernel_constraint","`",":","constraint","applied","to","the","weights",";"]
code: def call(self, inputs, mask=None):
      x, a = inputs
      output = self.apply_filters(x, a)
  
      if mask is not None:
          output *= mask[0]
      output = self.activation(output)
  
      return output
  
file_path: spektral/spektral/layers/convolutional/diffusion_conv.py
imports: import tensorflow
  import tensorflow.keras.layers
  from spektral.layers.convolutional.conv import Conv
  from spektral.utils import normalized_adjacency
label_desc: Use image node_id 4 for calling the DiffusionConv obj's underlying member method code with example usage: obj.call(inputs, mask) and returns: output