コード例 #1
0
 def _preprocess_features(self, features):
     """ The propagation step is made here"""
     if self.normalize_features:
         features = row_normalize(features)
     for i in range(self.num_layers):
         features = self.graph_adj @ features
     return to_sparse_tensor(features)
コード例 #2
0
 def _preprocess_features(self, features):
     """ The propagation step is made here"""
     if self.normalize_features:
         features = row_normalize(features)
     initial_features = features.copy()
     alpha = np.float32(self.teleport_prob)
     for i in range(self.num_layers):
         features = (
             1 -
             alpha) * self.graph_adj @ features + alpha * initial_features
     return to_sparse_tensor(features)
コード例 #3
0
ファイル: graphsage.py プロジェクト: yflyzhang/gnn-benchmark
 def _preprocess_features(self, features):
     if self.normalize_features:
         features = row_normalize(features)
     return to_sparse_tensor(features)
コード例 #4
0
ファイル: monet.py プロジェクト: yflyzhang/gnn-benchmark
 def _preprocess_features(self, features):
     if self.normalize_features:
         features = row_normalize(features)
     return tf.constant(features.todense())