[tune] tf2.0 testing and supporting callables (#5738)

This commit is contained in:
Richard Liaw
2019-09-21 17:01:14 -07:00
committed by GitHub
parent c91a37f622
commit e00071721a
6 changed files with 44 additions and 26 deletions
+5 -1
View File
@@ -32,7 +32,11 @@ class TuneReporterCallback(keras.callbacks.Callback):
for metric in list(logs):
if "loss" in metric and "neg_" not in metric:
logs["neg_" + metric] = -logs[metric]
self.reporter(keras_info=logs, mean_accuracy=logs["acc"])
print(logs)
if "acc" in logs:
self.reporter(keras_info=logs, mean_accuracy=logs["acc"])
else:
self.reporter(keras_info=logs, mean_accuracy=logs.get("accuracy"))
def on_epoch_end(self, batch, logs={}):
if not self.freq == "epoch":