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

Merge pull request #629 from lilleswing/set2set

Update Tox21 Graph Convs For New Layer Names
parents 9ec1cc90 e34aa6f2
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ from deepchem.models.tensorgraph import TensorGraph
from deepchem.metrics import to_one_hot

from deepchem.feat.mol_graphs import ConvMol
from deepchem.models.tensorgraph.layers import Input, GraphConvLayer, BatchNormLayer, GraphPoolLayer, Dense, GraphGather, \
from deepchem.models.tensorgraph.layers import Input, GraphConv, BatchNorm, GraphPool, Dense, GraphGather, \
  SoftMax, SoftMaxCrossEntropy, Concat, WeightedError, Label, Weights, Feature

np.random.seed(123)
@@ -36,22 +36,20 @@ def graph_conv_model(batch_size, tasks):
  for i in range(0, 10 + 1):
    deg_adj = Feature(shape=(None, i + 1), dtype=tf.int32)
    deg_adjs.append(deg_adj)
  gc1 = GraphConvLayer(
  gc1 = GraphConv(
      64,
      activation_fn=tf.nn.relu,
      in_layers=[atom_features, degree_slice, membership] + deg_adjs)
  batch_norm1 = BatchNormLayer(in_layers=[gc1])
  gp1 = GraphPoolLayer(
      in_layers=[batch_norm1, degree_slice, membership] + deg_adjs)
  gc2 = GraphConvLayer(
  batch_norm1 = BatchNorm(in_layers=[gc1])
  gp1 = GraphPool(in_layers=[batch_norm1, degree_slice, membership] + deg_adjs)
  gc2 = GraphConv(
      64,
      activation_fn=tf.nn.relu,
      in_layers=[gp1, degree_slice, membership] + deg_adjs)
  batch_norm2 = BatchNormLayer(in_layers=[gc2])
  gp2 = GraphPoolLayer(
      in_layers=[batch_norm2, degree_slice, membership] + deg_adjs)
  batch_norm2 = BatchNorm(in_layers=[gc2])
  gp2 = GraphPool(in_layers=[batch_norm2, degree_slice, membership] + deg_adjs)
  dense = Dense(out_channels=128, activation_fn=None, in_layers=[gp2])
  batch_norm3 = BatchNormLayer(in_layers=[dense])
  batch_norm3 = BatchNorm(in_layers=[dense])
  gg1 = GraphGather(
      batch_size=batch_size,
      activation_fn=tf.nn.tanh,