You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

base_trainer.py 810 B

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Copyright (c) Microsoft Corporation.
  2. # Licensed under the MIT license.
  3. from abc import ABC, abstractmethod
  4. class BaseTrainer(ABC):
  5. @abstractmethod
  6. def train(self):
  7. """
  8. Override the method to train.
  9. """
  10. raise NotImplementedError
  11. @abstractmethod
  12. def validate(self):
  13. """
  14. Override the method to validate.
  15. """
  16. raise NotImplementedError
  17. @abstractmethod
  18. def export(self, file):
  19. """
  20. Override the method to export to file.
  21. Parameters
  22. ----------
  23. file : str
  24. File path to export to.
  25. """
  26. raise NotImplementedError
  27. @abstractmethod
  28. def checkpoint(self):
  29. """
  30. Override to dump a checkpoint.
  31. """
  32. raise NotImplementedError

一站式算法开发平台、高性能分布式深度学习框架、先进算法模型库、视觉模型炼知平台、数据可视化分析平台等一系列平台及工具,在模型高效分布式训练、数据处理和可视分析、模型炼知和轻量化等技术上形成独特优势,目前已在产学研等各领域近千家单位及个人提供AI应用赋能