Commit c860937b authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #448 from ktaneishi/bt_gcv

fix new GraphConv methods' arguments bug.
parents 9eca0d40 30e02285
Loading
Loading
Loading
Loading
+82 −78
Original line number Diff line number Diff line
@@ -495,25 +495,27 @@ def benchmark_classification(train_dataset,
    sess = tf.Session(graph=g)
    K.set_session(sess)
    # Building graph convolution model
    with g.as_default():
    tf.set_random_seed(seed)
    graph_model = dc.nn.SequentialGraph(n_features)
      graph_model.add(dc.nn.GraphConv(int(n_filters), activation='relu'))
    graph_model.add(
        dc.nn.GraphConv(int(n_filters), n_features, activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphPool())
      graph_model.add(dc.nn.GraphConv(int(n_filters), activation='relu'))
    graph_model.add(
        dc.nn.GraphConv(int(n_filters), int(n_filters), activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphPool())
    # Gather Projection
    graph_model.add(
          dc.nn.Dense(int(n_fully_connected_nodes), activation='relu'))
        dc.nn.Dense(
            int(n_fully_connected_nodes), int(n_filters), activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphGather(batch_size, activation="tanh"))
    with tf.Session() as sess:
      model_graphconv = dc.models.MultitaskGraphClassifier(
            sess,
          graph_model,
          len(tasks),
          n_features,
          batch_size=batch_size,
          learning_rate=learning_rate,
          optimizer_type="adam",
@@ -693,25 +695,27 @@ def benchmark_regression(train_dataset,
    sess = tf.Session(graph=g)
    K.set_session(sess)
    # Building graph convoluwtion model
    with g.as_default():
    tf.set_random_seed(seed)
    graph_model = dc.nn.SequentialGraph(n_features)
      graph_model.add(dc.nn.GraphConv(int(n_filters), activation='relu'))
    graph_model.add(
        dc.nn.GraphConv(int(n_filters), n_features, activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphPool())
      graph_model.add(dc.nn.GraphConv(int(n_filters), activation='relu'))
    graph_model.add(
        dc.nn.GraphConv(int(n_filters), int(n_filters), activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphPool())
    # Gather Projection
    graph_model.add(
          dc.nn.Dense(int(n_fully_connected_nodes), activation='relu'))
        dc.nn.Dense(
            int(n_fully_connected_nodes), int(n_filters), activation='relu'))
    graph_model.add(dc.nn.BatchNormalization(epsilon=1e-5, mode=1))
    graph_model.add(dc.nn.GraphGather(batch_size, activation="tanh"))
    with tf.Session() as sess:
      model_graphconvreg = dc.models.MultitaskGraphRegressor(
            sess,
          graph_model,
          len(tasks),
          n_features,
          batch_size=batch_size,
          learning_rate=learning_rate,
          optimizer_type="adam",