Commit 1db83d19 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Cleanup

parent 6b0af106
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -2442,10 +2442,6 @@ class DAGLayer(tf.keras.layers.Layer):
    self.b_list.append(backend.zeros(shape=[
        self.n_outputs,
    ]))
    #with tf.init_scope():
    #  graph_features_initial = tf.zeros((self.max_atoms * self.batch_size,
    #                                     self.max_atoms + 1, self.n_graph_feat))
    #  self.graph_features = tf.Variable(graph_features_initial, trainable=False)
    self.built = True

  def call(self, inputs):
@@ -2462,14 +2458,6 @@ class DAGLayer(tf.keras.layers.Layer):

    n_atoms = tf.squeeze(inputs[4])
    dropout_switch = tf.squeeze(inputs[5])
    #with tf.init_scope():
    #  # initialize graph features for each graph
    #  graph_features_initial = tf.zeros((self.max_atoms * self.batch_size,
    #                                     self.max_atoms + 1, self.n_graph_feat))
    #  # initialize graph features for each graph
    #  # another row of zeros is generated for padded dummy atoms
    #  #graph_features = tf.Variable(graph_features_initial, trainable=False)
    #  self.graph_features.assign(graph_features_initial)
    graph_features = tf.zeros((self.max_atoms * self.batch_size,
                               self.max_atoms + 1, self.n_graph_feat))

@@ -2507,12 +2495,6 @@ class DAGLayer(tf.keras.layers.Layer):
      # index for targe atoms
      target_index = tf.stack([tf.range(n_atoms), parents[:, count, 0]], axis=1)
      target_index = tf.boolean_mask(target_index, mask)
      # update the graph features for target atoms
      #self.graph_features = tf.compat.v1.scatter_nd_update(
      #    self.graph_features, target_index, batch_outputs)
      #self.graph_features.assign_add(
      #    tf.compat.v1.scatter_nd_update(self.graph_features, target_index,
      #                                   batch_outputs))
      graph_features = tf.tensor_scatter_nd_update(graph_features, target_index,
                                                   batch_outputs)
    return batch_outputs
+0 −7
Original line number Diff line number Diff line
@@ -326,10 +326,3 @@ class TestGraphModels(unittest.TestCase):

    # Fit trained model
    model.fit(dataset, nb_epoch=1)
    #batch_size = 50
    #model = GraphConvModel(
    #    len(tasks), batch_size=batch_size, mode='classification')

    #model.fit(dataset, nb_epoch=10)
    #scores = model.evaluate(dataset, [metric], transformers)
    #assert scores['mean-roc_auc_score'] >= 0.9
+0 −2
Original line number Diff line number Diff line
@@ -385,8 +385,6 @@ class TestLayers(test_util.TensorFlowTestCase):
    ])
    ## TODO(rbharath): What is the shape of outputs supposed to be?
    ## I'm getting (7, 30) here. Where does 7 come from??
    #print("outputs.shape")
    #print(outputs.shape)

  def test_DAG_gather(self):
    """Test invoking DAGGather."""