def testTBX(self): config = {"a": 2, "b": 5} t = Trial(evaluated_params=config, trial_id="tbx") logger = TBXLogger(config=config, logdir=self.test_dir, trial=t) logger.on_result(result(2, 4)) logger.on_result(result(2, 4)) logger.close()
def testTBX(self): config = {"a": 2, "b": 5, "c": {"c": {"D": 123}, "e": None}} t = Trial(evaluated_params=config, trial_id="tbx") logger = TBXLogger(config=config, logdir=self.test_dir, trial=t) logger.on_result(result(0, 4)) logger.on_result(result(1, 4)) logger.on_result(result(2, 4, score=[1, 2, 3], hello={"world": 1})) logger.close()
def testLegacyBadTBX(self): config = {"b": (1, 2, 3)} t = Trial( evaluated_params=config, trial_id="tbx", logdir=self.test_dir) logger = TBXLogger(config=config, logdir=self.test_dir, trial=t) logger.on_result(result(0, 4)) logger.on_result(result(2, 4, score=[1, 2, 3], hello={"world": 1})) with self.assertLogs("ray.tune.logger", level="INFO") as cm: logger.close() assert "INFO" in cm.output[0]
def testLegacyTBX(self): config = { "a": 2, "b": [1, 2], "c": { "c": { "D": 123 } }, "d": np.int64(1), "e": np.bool8(True), "f": None, } t = Trial( evaluated_params=config, trial_id="tbx", logdir=self.test_dir) logger = TBXLogger(config=config, logdir=self.test_dir, trial=t) logger.on_result(result(0, 4)) logger.on_result(result(1, 5)) logger.on_result(result(2, 6, score=[1, 2, 3], hello={"world": 1})) logger.close() self._validate_tbx_result()