metrics object will be prepended with the prefix.
metrics (Any): The metrics object.
for field_name, field_value in metrics._asdict().items():
if isinstance(field_value, (int, float)):
self.summary_writer.add_scalar(
f"{prefix}/{field_name}", field_value, epoch
After Change
metrics object will be prepended with the prefix.
metrics (Any): The metrics object.
if hasattr(metrics, "_asdict"):
metrics = metrics._asdict()
for field_name, field_value in metrics.items():
if isinstance(field_value, (int, float)):
self.summary_writer.add_scalar(
f"{prefix}/{field_name}", field_value, epoch