in ludwig/contribs/comet.py [0:0]
def train_epoch_end(self, progress_tracker):
"""
Called from ludwig/models/model.py
"""
logger.info("comet.train_epoch_end() called......")
if self.cometml_experiment:
for item_name in ["batch_size", "epoch", "steps",
"last_improvement_epoch",
"learning_rate", "best_valid_metric",
"num_reductions_lr",
"num_increases_bs", "train_metrics", "vali_metrics",
"test_metrics"]:
try:
item = getattr(progress_tracker, item_name)
if isinstance(item, dict):
for key in item:
if isinstance(item[key], dict):
for key2 in item[key]:
self.cometml_experiment.log_metric(
item_name + "." + key + "." + key2,
item[key][key2][-1])
else:
self.cometml_experiment.log_metric(
item_name + "." + key, item[key][-1])
elif item is not None:
self.cometml_experiment.log_metric(item_name, item)
except Exception:
logger.info("comet.train_epoch_end() skip logging '%s'", item_name)