Пример #1
0
 def test_clips_historical_metric_values(self):
     history = trax_history.History()
     self._append_metrics(history, ('train', 'loss'), [-10, 10])
     metric_values = online_tune.historical_metric_values(
         history, metric=('train', 'loss'), observation_range=(-1, 1))
     np.testing.assert_array_equal(metric_values, [-1, 1])
Пример #2
0
 def test_retrieves_historical_metric_values(self):
     history = trax_history.History()
     self._append_metrics(history, ('train', 'accuracy'), [0.1, 0.73])
     metric_values = online_tune.historical_metric_values(
         history, metric=('train', 'accuracy'), observation_range=(0, 5))
     np.testing.assert_array_equal(metric_values, [0.1, 0.73])