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

Merge pull request #595 from lilleswing/flaky

Keep Trying to Help Flaky Tests
parents 8b464565 3564299c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ class TensorGraph(Model):
               use_queue=True,
               mode="regression",
               graph=None,
               learning_rate=0.001,
               **kwargs):
    """
    TODO(LESWING) allow a model to change its learning rate
@@ -65,7 +66,10 @@ class TensorGraph(Model):
    self.built = False
    self.queue_installed = False
    self.optimizer = TFWrapper(
        tf.train.AdamOptimizer, learning_rate=0.001, beta1=0.9, beta2=0.999)
        tf.train.AdamOptimizer,
        learning_rate=learning_rate,
        beta1=0.9,
        beta2=0.999)

    # Singular place to hold Tensor objects which don't serialize
    # These have to be reconstructed on restoring from pickle
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import scipy.io
from tensorflow.python.framework import test_util
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import RandomForestRegressor
from flaky import flaky


class TestOverfit(test_util.TensorFlowTestCase):
@@ -548,6 +549,7 @@ class TestOverfit(test_util.TensorFlowTestCase):
    scores = model.evaluate(dataset, [classification_metric])
    assert scores[classification_metric.name] > .9

  @flaky
  def test_tg_multitask_classification_overfit(self):
    """Test TensorGraph multitask overfits tiny data."""
    n_tasks = 10
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class TestGeneratorEvaluator(TestCase):

    total_loss = ReduceMean(in_layers=entropies)

    tg = dc.models.TensorGraph(learning_rate=0.01)
    tg = dc.models.TensorGraph(learning_rate=0.01, batch_size=n_data_points)
    for output in outputs:
      tg.add_output(output)
    tg.set_loss(total_loss)