dgl.DGLGraph的理解

类形式:

class  dgl.DGLGraph(graph_data=Nonenode_frame=Noneedge_frame=Nonemultigraph=Nonereadonly=Falsesort_csr=Falsebatch_num_nodes=Nonebatch_num_edges=Noneparent=None)

是图的基类,图存储顶点,边和他们的特征。

DGL图总是有向的。

无向图可以通过两个有向的边来表示。

节点由从零开始的连续整数标识。

边可以由两个端点(u,v)或添加边时指定的整数id指定。边ID按添加顺序自动分配,即添加的第一条边的ID为0,第二条为1,依此类推。

节点和边缘特征以字典形式存储,从特征名称到特征数据(以张量表示)。

DGLGraph可以接受多种格式的图数据:

(1)NetworkX graph,

  (2)scipy matrix,

  (3)DGLGraph.

如果输入的图数据是DGLGraph,构造的DGLGraph只包含它的图索引。

Parameters:
  • graph_data (graph dataoptional) – Data to initialize graph.
  • node_frame (FrameRefoptional) – Node feature storage.
  • edge_frame (FrameRefoptional) – Edge feature storage.
  • multigraph (booloptional) – Deprecated (Will be deleted in the future). Whether the graph would be a multigraph. If none, the flag will be set to True. (default: None)
  • readonly (booloptional) – Whether the graph structure is read-only (default: False).

 

 

 

你可能感兴趣的:(python,python,神经网络)