class_docstr: Gaussian Mixture Model Convolution layer from `Geometric Deep Learning on Graphs and
  Manifolds using Mixture Model CNNs <https://arxiv.org/abs/1611.08402>`__
  
  .. math::
      u_{ij} &= f(x_i, x_j), x_j \in \mathcal{N}(i)
  
      w_k(u) &= \exp\left(-\frac{1}{2}(u-\mu_k)^T \Sigma_k^{-1} (u - \mu_k)\right)
  
      h_i^{l+1} &= \mathrm{aggregate}\left(\left\{\frac{1}{K}
       \sum_{k}^{K} w_k(u_{ij}), \forall j\in \mathcal{N}(i)\right\}\right)
  
  where :math:`u` denotes the pseudo-coordinates between a vertex and one of its neighbor,
  computed using function :math:`f`, :math:`\Sigma_k^{-1}` and :math:`\mu_k` are
  learnable parameters representing the covariance matrix and mean vector of a Gaussian kernel.
  
  Parameters
  ----------
  in_feats : int
      Number of input features; i.e., the number of dimensions of :math:`x_i`.
  out_feats : int
      Number of output features; i.e., the number of dimensions of :math:`h_i^{(l+1)}`.
  dim : int
      Dimensionality of pseudo-coordinte; i.e, the number of dimensions of :math:`u_{ij}`.
  n_kernels : int
      Number of kernels :math:`K`.
  aggregator_type : str
      Aggregator type (``sum``, ``mean``, ``max``). Default: ``sum``.
  residual : bool
      If True, use residual connection inside this layer. Default: ``False``.
  bias : bool
      If True, adds a learnable bias to the output. Default: ``True``.
  allow_zero_in_degree : bool, optional
      If there are 0-in-degree nodes in the graph, output for those nodes will be invalid
      since no message will be passed to those nodes. This is harmful for some applications
      causing silent performance regression. This module will raise a DGLError if it detects
      0-in-degree nodes in input graph. By setting ``True``, it will suppress the check
      and let the users handle it by themselves. Default: ``False``.
  
  Note
  ----
  Zero in-degree nodes will lead to invalid output value. This is because no message
  will be passed to those nodes, the aggregation function will be appied on empty input.
  A common practice to avoid this is to add a self-loop for each node in the graph if
  it is homogeneous, which can be achieved by:
  
  >>> g = ... # a DGLGraph
  >>> g = dgl.add_self_loop(g)
  
  Calling ``add_self_loop`` will not work for some graphs, for example, heterogeneous graph
  since the edge type can not be decided for self_loop edges. Set ``allow_zero_in_degree``
  to ``True`` for those cases to unblock the code and handle zero-in-degree nodes manually.
  A common practise to handle this is to filter out the nodes with zero-in-degree when use
  after conv.
  
  Examples
  --------
  >>> import dgl
  >>> import numpy as np
  >>> import mxnet as mx
  >>> from dgl.nn import GMMConv
  >>>
  >>> # Case 1: Homogeneous graph
  >>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
  >>> g = dgl.add_self_loop(g)
  >>> feat = mx.nd.ones((6, 10))
  >>> conv = GMMConv(10, 2, 3, 2, 'mean')
  >>> conv.initialize(ctx=mx.cpu(0))
  >>> pseudo = mx.nd.ones((12, 3))
  >>> res = conv(g, feat, pseudo)
  >>> res
  [[-0.05083769 -0.1567954 ]
  [-0.05083769 -0.1567954 ]
  [-0.05083769 -0.1567954 ]
  [-0.05083769 -0.1567954 ]
  [-0.05083769 -0.1567954 ]
  [-0.05083769 -0.1567954 ]]
  <NDArray 6x2 @cpu(0)>
  
  >>> # Case 2: Unidirectional bipartite graph
  >>> u = [0, 1, 0, 0, 1]
  >>> v = [0, 1, 2, 3, 2]
  >>> g = dgl.heterograph({('_N', '_E', '_N'):(u, v)})
  >>> u_fea = mx.nd.random.randn(2, 5)
  >>> v_fea = mx.nd.random.randn(4, 10)
  >>> pseudo = mx.nd.ones((5, 3))
  >>> conv = GMMConv((5, 10), 2, 3, 2, 'mean')
  >>> conv.initialize(ctx=mx.cpu(0))
  >>> res = conv(g, (u_fea, v_fea), pseudo)
  >>> res
  [[-0.1005067  -0.09494358]
  [-0.0023314  -0.07597432]
  [-0.05141905 -0.08545895]
  [-0.1005067  -0.09494358]]
  <NDArray 4x2 @cpu(0)>
class_docstr_tok: ["Gaussian","Mixture","Model","Convolution","layer","from","`","Geometric","Deep","Learning","on","Graphs","and","Manifolds","using","Mixture","Model","CNNs","<","https",":","\/\/arxiv.org\/abs\/1611.08402",">","`","__","..","math",":",":","u_","{","ij","}","&","=","f","(","x_i",",","x_j",")",",","x_j","\\in","\\mathcal","{","N","}","(","i",")","w_k","(","u",")","&","=","\\exp\\left","(","-\\frac","{","1","}","{","2","}","(","u-\\mu_k",")","^T","\\Sigma_k^","{","-1","}","(","u","-","\\mu_k",")","\\right",")","h_i^","{","l+1","}","&","=","\\mathrm","{","aggregate","}","\\left","(","\\left\\","{","\\frac","{","1","}","{","K","}","\\sum_","{","k","}","^","{","K","}","w_k","(","u_","{","ij","}",")",",","\\forall","j\\in","\\mathcal","{","N","}","(","i",")","\\right\\","}","\\right",")","where",":","math",":","`","u","`","denotes","the","pseudo-coordinates","between","a","vertex","and","one","of","its","neighbor",",","computed","using","function",":","math",":","`","f","`",",",":","math",":","`","\\Sigma_k^","{","-1","}","`","and",":","math",":","`","\\mu_k","`","are","learnable","parameters","representing","the","covariance","matrix","and","mean","vector","of","a","Gaussian","kernel",".","Parameters","--","--","--","--","--","in_feats",":","int","Number","of","input","features",";","i.e.",",","the","number","of","dimensions","of",":","math",":","`","x_i","`",".","out_feats",":","int","Number","of","output","features",";","i.e.",",","the","number","of","dimensions","of",":","math",":","`","h_i^","{","(","l+1",")","}","`",".","dim",":","int","Dimensionality","of","pseudo-coordinte",";","i.e",",","the","number","of","dimensions","of",":","math",":","`","u_","{","ij","}","`",".","n_kernels",":","int","Number","of","kernels",":","math",":","`","K","`",".","aggregator_type",":","str","Aggregator","type","(","``","sum","``",",","``","mean","``",",","``","max","``",")",".","Default",":","``","sum","``",".","residual",":","bool","If","True",",","use","residual","connection","inside","this","layer",".","Default",":","``","False","``",".","bias",":","bool","If","True",",","adds","a","learnable","bias","to","the","output",".","Default",":","``","True","``",".","allow_zero_in_degree",":","bool",",","optional","If","there","are","0-in-degree","nodes","in","the","graph",",","output","for","those","nodes","will","be","invalid","since","no","message","will","be","passed","to","those","nodes",".","This","is","harmful","for","some","applications","causing","silent","performance","regression",".","This","module","will","raise","a","DGLError","if","it","detects","0-in-degree","nodes","in","input","graph",".","By","setting","``","True","``",",","it","will","suppress","the","check","and","let","the","users","handle","it","by","themselves",".","Default",":","``","False","``",".","Note","--","--","Zero","in-degree","nodes","will","lead","to","invalid","output","value",".","This","is","because","no","message","will","be","passed","to","those","nodes",",","the","aggregation","function","will","be","appied","on","empty","input",".","A","common","practice","to","avoid","this","is","to","add","a","self-loop","for","each","node","in","the","graph","if","it","is","homogeneous",",","which","can","be","achieved","by",":",">",">",">","g","=","...","#","a","DGLGraph",">",">",">","g","=","dgl.add_self_loop","(","g",")","Calling","``","add_self_loop","``","will","not","work","for","some","graphs",",","for","example",",","heterogeneous","graph","since","the","edge","type","can","not","be","decided","for","self_loop","edges",".","Set","``","allow_zero_in_degree","``","to","``","True","``","for","those","cases","to","unblock","the","code","and","handle","zero-in-degree","nodes","manually",".","A","common","practise","to","handle","this","is","to","filter","out","the","nodes","with","zero-in-degree","when","use","after","conv",".","Examples","--","--","--","--",">",">",">","import","dgl",">",">",">","import","numpy","as","np",">",">",">","import","mxnet","as","mx",">",">",">","from","dgl.nn","import","GMMConv",">",">",">",">",">",">","#","Case","1",":","Homogeneous","graph",">",">",">","g","=","dgl.graph","(","(","[","0,1,2,3,2,5","]",",","[","1,2,3,4,0,3","]",")",")",">",">",">","g","=","dgl.add_self_loop","(","g",")",">",">",">","feat","=","mx.nd.ones","(","(","6",",","10",")",")",">",">",">","conv","=","GMMConv","(","10",",","2",",","3",",","2",",","'mean","'",")",">",">",">","conv.initialize","(","ctx=mx.cpu","(","0",")",")",">",">",">","pseudo","=","mx.nd.ones","(","(","12",",","3",")",")",">",">",">","res","=","conv","(","g",",","feat",",","pseudo",")",">",">",">","res","[","[","-0.05083769","-0.1567954","]","[","-0.05083769","-0.1567954","]","[","-0.05083769","-0.1567954","]","[","-0.05083769","-0.1567954","]","[","-0.05083769","-0.1567954","]","[","-0.05083769","-0.1567954","]","]","<","NDArray","6x2","@","cpu","(","0",")",">",">",">",">","#","Case","2",":","Unidirectional","bipartite","graph",">",">",">","u","=","[","0",",","1",",","0",",","0",",","1","]",">",">",">","v","=","[","0",",","1",",","2",",","3",",","2","]",">",">",">","g","=","dgl.heterograph","(","{","(","'_N","'",",","'_E","'",",","'_N","'",")",":","(","u",",","v",")","}",")",">",">",">","u_fea","=","mx.nd.random.randn","(","2",",","5",")",">",">",">","v_fea","=","mx.nd.random.randn","(","4",",","10",")",">",">",">","pseudo","=","mx.nd.ones","(","(","5",",","3",")",")",">",">",">","conv","=","GMMConv","(","(","5",",","10",")",",","2",",","3",",","2",",","'mean","'",")",">",">",">","conv.initialize","(","ctx=mx.cpu","(","0",")",")",">",">",">","res","=","conv","(","g",",","(","u_fea",",","v_fea",")",",","pseudo",")",">",">",">","res","[","[","-0.1005067","-0.09494358","]","[","-0.0023314","-0.07597432","]","[","-0.05141905","-0.08545895","]","[","-0.1005067","-0.09494358","]","]","<","NDArray","4x2","@","cpu","(","0",")",">"]
docstr: Description
  -----------
  Set allow_zero_in_degree flag.
  
  Parameters
  ----------
  set_value : bool
      The value to be set to the flag.
docstr_tok: ["Description","--","--","--","--","--","-","Set","allow_zero_in_degree","flag",".","Parameters","--","--","--","--","--","set_value",":","bool","The","value","to","be","set","to","the","flag","."]
code: def set_allow_zero_in_degree(self, set_value):
      r"""
  
      Description
      -----------
      Set allow_zero_in_degree flag.
  
      Parameters
      ----------
      set_value : bool
          The value to be set to the flag.
      """
      self._allow_zero_in_degree = set_value
  
file_path: dgl/python/dgl/nn/mxnet/conv/gmmconv.py
imports: import math
  import mxnet
  from mxnet import nd
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.nn import Identity
  from ....None import function
  from ....base import DGLError
  from ....utils import expand_as_pair
label_desc: Use image node_id 2 for calling the GMMConv obj's underlying member method code with example usage: obj.set_allow_zero_in_degree(set_value) without return types