loggers.py 582 B

123456789101112131415161718
  1. from .wandb_logger import WandbLogger
  2. class Loggers(object):
  3. def __init__(self, loggers):
  4. super().__init__()
  5. self.loggers = loggers
  6. def log_metrics(self, metrics, prefix=None, step=None):
  7. for logger in self.loggers:
  8. logger.log_metrics(metrics, prefix=prefix, step=step)
  9. def log_model(self, is_best, prefix, metadata=None):
  10. for logger in self.loggers:
  11. logger.log_model(is_best=is_best, prefix=prefix, metadata=metadata)
  12. def close(self):
  13. for logger in self.loggers:
  14. logger.close()