GraphSignals

GraphSignals.FeaturedGraphType
FeaturedGraph(graph, node_feature, edge_feature, global_feature, mt, directed)

A feature-equipped graph structure for passing graph to layer in order to provide graph dynamically. References to graph or features are hold in this type.

Arguments

  • graph: should be a adjacency matrix, SimpleGraph, SimpleDiGraph (from LightGraphs) or SimpleWeightedGraph,

SimpleWeightedDiGraph (from SimpleWeightedGraphs).

  • node_feature: node features attached to graph.
  • edge_feature: edge features attached to graph.
  • gloabl_feature: gloabl graph features attached to graph.
  • mask: mask for graph.
  • mt: matrix type for graph in matrix form. if graph is in matrix form, mt is recorded as one of :adjm,

:laplacian, :normalized or :scaled. Otherwise, :nonmatrix is recorded.

  • directed: the direction of graph. it is true for directed graph; it is false for undirected graph.
GraphSignals.aggregate_indexFunction
aggregate_index(ei; direction=:undirected, kind=:edge)

Generate index structure for scatter operation.

Arguments

  • ei::EdgeIndex: The reference graph.
  • direction::Symbol: The direction of an edge to be choose to aggregate. It must be one of :undirected, :inward and :outward.
  • kind::Symbol: To aggregate feature upon edge or vertex. It must be one of :edge and :vertex.
GraphSignals.edge_scatterMethod
edge_scatter(aggr, E, ei, direction=:undirected)

Scatter operation for aggregating edge feature into vertex feature.

Arguments

  • aggr: aggregating operators, e.g. +.
  • E: Edge features with size of (#feature, #edge).
  • ei::EdgeIndex: The reference graph.
  • direction::Symbol: The direction of an edge to be choose to aggregate. It must be one of :undirected, :inward and :outward.
GraphSignals.fetch_graphMethod
fetch_graph(g1, g2)

Fetch graph from g1 or g2. If there is only one graph available, fetch that one. Otherwise, fetch the first one.

GraphSignals.maskMethod
mask(fg, m)

A syntax sugar for masking graph.

Returns a GraphMask.

GraphSignals.neighbor_scatterMethod
neighbor_scatter(aggr, X, ei, direction=:undirected)

Scatter operation for aggregating neighbor vertex feature together.

Arguments

  • aggr: aggregating operators, e.g. +.
  • X: Vertex features with size of (#feature, #vertex).
  • ei::EdgeIndex: The reference graph.
  • direction::Symbol: The direction of an edge to be choose to aggregate. It must be one of :undirected, :inward and :outward.
LightGraphs.neMethod
ne(::AbstractFeaturedGraph)

Get edge number of graph.

LightGraphs.nvMethod
nv(::AbstractFeaturedGraph)

Get node number of graph.