base_logger.py 324 B

123456789101112131415
  1. import os
  2. from abc import ABC, abstractmethod
  3. class BaseLogger(ABC):
  4. def __init__(self, save_dir):
  5. self.save_dir = save_dir
  6. os.makedirs(self.save_dir, exist_ok=True)
  7. @abstractmethod
  8. def log_metrics(self, metrics, prefix=None):
  9. pass
  10. @abstractmethod
  11. def close(self):
  12. pass