Commit 2a38236e authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Removing debugging cruft

parent 5e9f384f
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -47,29 +47,10 @@ class TestShuffle(TestAPI):
    dataset.shuffle(iterations=5)
    X_new, y_new, w_new, new_ids = dataset.to_numpy()
    
    #print("X_orig.shape, y_orig.shape, w_orig.shape, orig_ids.shape")
    #print(X_orig.shape, y_orig.shape, w_orig.shape, orig_ids.shape)
    #print("X_new.shape, y_new.shape, w_new.shape, new_ids.shape")
    #print(X_new.shape, y_new.shape, w_new.shape, new_ids.shape)
    #print("len(dataset), orig_len")
    assert len(dataset) == orig_len
    # The shuffling should have switched up the ordering
    assert not np.array_equal(orig_ids, new_ids)
    # But all the same entries should still be present
    ################################################## DEBUG
    #print("orig_ids")
    #print(orig_ids)
    #print("len(orig_ids)")
    #print(len(orig_ids))
    #print("new_ids")
    #print(new_ids)
    #print("len(new_ids)")
    #print(len(new_ids))
    #print("sorted(orig_ids)")
    #print(sorted(orig_ids))
    #print("sorted(new_ids)")
    #print(sorted(new_ids))
    ################################################## DEBUG
    assert sorted(orig_ids) == sorted(new_ids)
    # All the data should have same shape
    assert X_orig.shape == X_new.shape
+0 −4
Original line number Diff line number Diff line
@@ -138,10 +138,6 @@ class Model(object):
    y_preds = []
    batch_size = self.model_params["batch_size"]
    for (X_batch, y_batch, w_batch, ids_batch) in dataset.iterbatches(batch_size):
      ################################################ DEBUG
      #print("y_batch.shape, self.predict_on_batch(X_batch).shape")
      #print(y_batch.shape, self.predict_on_batch(X_batch).shape)
      ################################################ DEBUG
      y_pred_batch = np.reshape(self.predict_on_batch(X_batch), y_batch.shape)
      y_pred_batch = undo_transforms(y_pred_batch, transformers)
      y_preds.append(y_pred_batch)
+0 −13
Original line number Diff line number Diff line
@@ -104,18 +104,9 @@ class NormalizationTransformer(Transformer):
    self.X_means = X_means 
    self.X_stds = X_stds
    self.y_means = y_means 
    ############################################### DEBUG
    # Control for pathological case with no variance.
    y_stds[y_stds == 0] = 1.
    ############################################### DEBUG
    self.y_stds = y_stds
    ########################################################## DEBUG
    #print("NormalizationTransformer()")
    #print("self.y_means, self.y_stds")
    #print(self.y_means, self.y_stds)
    #print("np.std(dataset.get_labels())")
    #print(np.std(dataset.get_labels()))
    ########################################################## DEBUG

  def transform(self, dataset, parallel=False):
    super(NormalizationTransformer, self).transform(
@@ -186,16 +177,12 @@ class LogTransformer(Transformer):
    row = df.iloc[i]
    if self.transform_X:
      X = load_from_disk(os.path.join(data_dir, row['X-transformed']))
      ########################################################## DEBUG 
      X = np.log(X+1)
      ########################################################## DEBUG 
      save_to_disk(X, os.path.join(data_dir, row['X-transformed']))

    if self.transform_y:
      y = load_from_disk(os.path.join(data_dir, row['y-transformed']))
      ########################################################## DEBUG 
      y = np.log(y+1)
      ########################################################## DEBUG 
      save_to_disk(y, os.path.join(data_dir, row['y-transformed']))

  def untransform(self, z):
+0 −14
Original line number Diff line number Diff line
@@ -70,13 +70,6 @@ class Evaluator(object):
    """
    y = self.dataset.get_labels()
    y = undo_transforms(y, self.transformers)
    ############################################ DEBUG
    #print("self.dataset.get_labels().shape")
    #print(self.dataset.get_labels().shape)
    #print("Undoing transforms.")
    #print("y.shape")
    #print(y.shape)
    ############################################ DEBUG
    w = self.dataset.get_weights()

    if not len(metrics):
@@ -98,13 +91,6 @@ class Evaluator(object):
    # Compute multitask metrics
    for metric in metrics:
      multitask_scores[metric.name] = metric.compute_metric(y, y_pred, w)
      ##################################################### DEBUG
      #print("compute_model_performance()")
      #print("y[w != 0], y_pred[w != 0]")
      #print(y[w != 0], y_pred[w != 0])
      #print("multitask_scores[metric.name]")
      #print(multitask_scores[metric.name])
      ##################################################### DEBUG
    
    if stats_out is not None:
      log("Saving stats to %s" % stats_out, self.verbosity)