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.

retrainer.py 1.1 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from abc import ABC, abstractmethod
  2. class Retrainer(ABC):
  3. """
  4. Train the best performance model from scratch without structure optimization.
  5. To implement a new selector, users need to implement:
  6. method: "train"
  7. method: "__init__"
  8. super().__init__() must be called in __init__ method
  9. parameters:
  10. -----------
  11. candidates: candidates to be evaluated
  12. """
  13. @abstractmethod
  14. def train(self):
  15. """
  16. Override the method to train.
  17. """
  18. raise NotImplementedError
  19. def validate(self):
  20. """
  21. Override the method to validate.
  22. """
  23. raise NotImplementedError
  24. def export(self, file):
  25. """
  26. Override the method to export to file.
  27. Parameters
  28. ----------
  29. file : str
  30. File path to export to.
  31. """
  32. raise NotImplementedError
  33. def checkpoint(self):
  34. """
  35. Override to dump a checkpoint.
  36. """
  37. raise NotImplementedError

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