コード例 #1
0
 def test_make_early_stopping_hook_valueerror(self):
   with self.assertRaises(ValueError):
     early_stopping.make_early_stopping_hook(
         self._estimator,
         should_stop_fn=lambda: True,
         run_every_secs=60,
         run_every_steps=100)
コード例 #2
0
 def test_make_early_stopping_hook_typeerror(self):
   with self.assertRaises(TypeError):
     early_stopping.make_early_stopping_hook(
         estimator=object(), should_stop_fn=lambda: True)
コード例 #3
0
 def test_make_early_stopping_hook(self, should_stop):
   self.run_session([
       early_stopping.make_early_stopping_hook(
           self._estimator, should_stop_fn=lambda: should_stop)
   ], should_stop)