MCPcopy Create free account
hub / github.com/LBANN/lbann / forward

Method forward

python/lbann/modules/graph/sparse/GraphConv.py:93–115  ·  view source on GitHub ↗

Apply Graph Conv Layer Args: node_feature_mat (Layer): Node feature matrix with the shape of (num_nodes,input_channels) source_indices (Layer): Source node indices of the edges with shape (num_nodes) target_indices (Layer): Target node indices of the edge

(self, node_feature_mat, source_indices, target_indices)

Source from the content-addressed store, hash-verified

91 name=self.name+"_Message_FC_layer")
92
93 def forward(self, node_feature_mat, source_indices, target_indices):
94 """Apply Graph Conv Layer
95
96 Args:
97 node_feature_mat (Layer): Node feature matrix with the shape of (num_nodes,input_channels)
98 source_indices (Layer): Source node indices of the edges with shape (num_nodes)
99 target_indices (Layer): Target node indices of the edges with shape (num_nodes)
100 Returns:
101 (Layer) : The output after kernel ops. The output can passed into another Graph Conv layer
102 directly
103 """
104
105
106 new_self_features = self.id_nn(node_feature_mat)
107
108 new_neighbor_features = self.mat_nn(node_feature_mat)
109 # Place the new features on to neighborhoods
110 neighborhoods = GraphExpand(new_neighbor_features, target_indices)
111 # Accumulate Messages from Neighboring Nodes
112 reduced_features = GraphReduce(neighborhoods, source_indices, [self.num_nodes, self.output_channel_size])
113
114 out_features = lbann.Sum(new_self_features, reduced_features)
115 return out_features

Callers

nothing calls this directly

Calls 2

GraphExpandFunction · 0.90
GraphReduceFunction · 0.90

Tested by

no test coverage detected