Commit 4712adac authored by leswing's avatar leswing
Browse files

YAPF

parent f69999e1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ transformers = [
]
for transformer in transformers:
  train_dataset = transformer.transform(train_dataset)
  test_dataset = transformer.transform(test_dataset)

at = [1., 6, 7., 8., 9., 11., 12., 15., 16., 17., 20., 25., 30., 35., 53.]
radial = [[12.0], [0.0, 4.0, 8.0], [4.0]]
@@ -85,7 +86,7 @@ train_evaluator = dc.utils.evaluate.Evaluator(model, train_dataset,
train_scores = train_evaluator.compute_model_performance(metric)
print("Train scores")
print(train_scores)

print("Prediction")
predictions = model.predict(test_dataset, transformers)
print(predictions)
test_evaluator = dc.utils.evaluate.Evaluator(model, test_dataset, transformers)
test_scores = test_evaluator.compute_model_performance(metric)
print("Test scores")
print(test_scores)
+2 −2
Original line number Diff line number Diff line
@@ -80,8 +80,8 @@ def AtomicNNLayer(tensor, size, weights, biases, name=None):
  """

  if len(tensor.get_shape()) != 2:
    raise ValueError(
        'Dense layer input must be 2D, not %dD' % len(tensor.get_shape()))
    raise ValueError('Dense layer input must be 2D, not %dD' %
                     len(tensor.get_shape()))
  with tf.name_scope(name, 'fully_connected', [tensor, weights, biases]):
    return tf.nn.xw_plus_b(tensor, weights, biases)

+10 −9
Original line number Diff line number Diff line
@@ -416,8 +416,8 @@ class TensorflowGraphModel(Model):
    feeding and fetching the same tensor.
    """
    weights = []
    placeholder_scope = TensorflowGraph.get_placeholder_scope(
        graph, name_scopes)
    placeholder_scope = TensorflowGraph.get_placeholder_scope(graph,
                                                              name_scopes)
    with placeholder_scope:
      for task in range(self.n_tasks):
        weights.append(
@@ -605,7 +605,8 @@ class TensorflowClassifier(TensorflowGraphModel):
      example.
    """
    return tf.multiply(
        tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels), weights)
        tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels),
        weights)

  def add_label_placeholders(self, graph, name_scopes):
    """Add Placeholders for labels for each task.
@@ -616,8 +617,8 @@ class TensorflowClassifier(TensorflowGraphModel):
    Placeholders are wrapped in identity ops to avoid the error caused by
    feeding and fetching the same tensor.
    """
    placeholder_scope = TensorflowGraph.get_placeholder_scope(
        graph, name_scopes)
    placeholder_scope = TensorflowGraph.get_placeholder_scope(graph,
                                                              name_scopes)
    with graph.as_default():
      batch_size = self.batch_size
      n_classes = self.n_classes
@@ -769,8 +770,8 @@ class TensorflowRegressor(TensorflowGraphModel):
    Placeholders are wrapped in identity ops to avoid the error caused by
    feeding and fetching the same tensor.
    """
    placeholder_scope = TensorflowGraph.get_placeholder_scope(
        graph, name_scopes)
    placeholder_scope = TensorflowGraph.get_placeholder_scope(graph,
                                                              name_scopes)
    with graph.as_default():
      batch_size = self.batch_size
      labels = []
@@ -858,8 +859,8 @@ class TensorflowMultiTaskRegressor(TensorflowRegressor):
        batch_size x n_features.
    """
    n_features = self.n_features
    placeholder_scope = TensorflowGraph.get_placeholder_scope(
        graph, name_scopes)
    placeholder_scope = TensorflowGraph.get_placeholder_scope(graph,
                                                              name_scopes)
    with graph.as_default():
      with placeholder_scope:
        self.mol_features = tf.placeholder(