Commit 038d5cb0 authored by ktaneishi's avatar ktaneishi
Browse files

remove with g.as_default() lines since these are not required no longer.

formatted with yapf
parent e704aa98
Loading
Loading
Loading
Loading
+82 −78
Original line number Diff line number Diff line
@@ -495,18 +495,20 @@ 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), n_features, 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), 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), int(n_filters), 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:
@@ -693,18 +695,20 @@ 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), n_features, 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), 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), int(n_filters), 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: