class_docstr: An implementation of `"Invariant Graph Embedding" <https://graphreason.github.io/papers/16.pdf>`_
  from the ICML 2019 Workshop on Learning and Reasoning with Graph-Structured
  Data paper "Invariant Embedding for Graph Classification". The procedure
  computes a mixture of spectral and node embedding based features. Specifically,
  it uses scattering, eigenvalues and pooled node feature embeddings to create
  graph descriptors.
  
  Args:
      feature_embedding_dimensions (list): Feature embedding dimensions. Default is [3, 5]
      spectral_embedding_dimensions (list): Spectral embedding dimensions. Default is [10, 20].
      histogram_bins (list): Number of histogram bins. Default is [10, 20].
      seed (int): Random seed value. Default is 42.
class_docstr_tok: ["An","implementation","of","`","``","Invariant","Graph","Embedding","''","<","https",":","\/\/graphreason.github.io\/papers\/16.pdf",">","`","_","from","the","ICML","2019","Workshop","on","Learning","and","Reasoning","with","Graph-Structured","Data","paper","``","Invariant","Embedding","for","Graph","Classification","''",".","The","procedure","computes","a","mixture","of","spectral","and","node","embedding","based","features",".","Specifically",",","it","uses","scattering",",","eigenvalues","and","pooled","node","feature","embeddings","to","create","graph","descriptors",".","Args",":","feature_embedding_dimensions","(","list",")",":","Feature","embedding","dimensions",".","Default","is","[","3",",","5","]","spectral_embedding_dimensions","(","list",")",":","Spectral","embedding","dimensions",".","Default","is","[","10",",","20","]",".","histogram_bins","(","list",")",":","Number","of","histogram","bins",".","Default","is","[","10",",","20","]",".","seed","(","int",")",":","Random","seed","value",".","Default","is","42","."]
docstr: Creating a sparse inverse degree matrix.
  
  Arg types:
      * **graph** *(NetworkX graph)* - The graph to be embedded.
  
  Return types:
      * **D_inverse** *(Scipy array)* - Diagonal inverse degree matrix.
docstr_tok: ["Creating","a","sparse","inverse","degree","matrix",".","Arg","types",":","*","*","*","graph","*","*","*","(","NetworkX","graph",")","*","-","The","graph","to","be","embedded",".","Return","types",":","*","*","*","D_inverse","*","*","*","(","Scipy","array",")","*","-","Diagonal","inverse","degree","matrix","."]
code: def _create_D_inverse(self, graph):
      """
      Creating a sparse inverse degree matrix.
  
      Arg types:
          * **graph** *(NetworkX graph)* - The graph to be embedded.
  
      Return types:
          * **D_inverse** *(Scipy array)* - Diagonal inverse degree matrix.
      """
      index = np.arange(graph.number_of_nodes())
      values = np.array(
          [
              1.0 / graph.degree[node]
              for node in range(graph.number_of_nodes())
          ]
      )
      shape = (graph.number_of_nodes(), graph.number_of_nodes())
      D_inverse = sps.coo_matrix((values, (index, index)), shape=shape)
      return D_inverse
  
file_path: karateclub/karateclub/graph_embedding/ige.py
imports: from typing import List
  import numpy
  import networkx
  import scipy.sparse
  from karateclub.estimator import Estimator
label_desc: Use image node_id 2 for calling the IGE obj's underlying member method code with example usage: obj._create_D_inverse(graph) and returns: D_inverse