Example #1
0
 def test_graphcnnpool(self):
     """ Test GraphCNNPool Layer From https://arxiv.org/abs/1703.00792"""
     V = np.random.uniform(size=(10, 100, 50)).astype(np.float32)
     adjs = np.random.uniform(size=(10, 100, 5, 100)).astype(np.float32)
     with self.session() as sess:
         vertex_props, adjs = GraphEmbedPoolLayer(num_vertices=6)(V, adjs)
         sess.run(tf.global_variables_initializer())
         vertex_props, adjs = vertex_props.eval(), adjs.eval()
         assert vertex_props.shape == (10, 6, 50)
         assert adjs.shape == (10, 6, 5, 6)
Example #2
0
 def test_graphcnnpool(self):
   """ Test GraphCNNPool Layer From https://arxiv.org/abs/1703.00792"""
   V = np.random.uniform(size=(10, 100, 50)).astype(np.float32)
   adjs = np.random.uniform(size=(10, 100, 5, 100)).astype(np.float32)
   with self.session() as sess:
     vertex_props, adjs = GraphEmbedPoolLayer(num_vertices=6)(V, adjs)
     sess.run(tf.global_variables_initializer())
     vertex_props, adjs = vertex_props.eval(), adjs.eval()
     assert vertex_props.shape == (10, 6, 50)
     assert adjs.shape == (10, 6, 5, 6)
Example #3
0
def testGraphCNNPoolLayer_pickle():
  V = Feature(shape=(None, 200, 50))
  A = Feature(shape=(None, 200, 1, 200))
  gcnnpool = GraphEmbedPoolLayer(32, in_layers=[V, A])
  tg = TensorGraph()
  tg.add_output(gcnnpool)
  tg.set_loss(gcnnpool)
  tg.build()
  tg.save()