Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#664 Add log readme

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-610-document_log_prints
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  1. class KDModelException(Exception):
  2. """Exception raised illegal training param format.
  3. Attributes:
  4. message -- explanation of the error
  5. """
  6. def __init__(self, desc):
  7. self.message = "KDTrainer: " + desc
  8. super().__init__(self.message)
  9. class ArchitectureKwargsException(KDModelException):
  10. """Exception raised when subnet architectures are not defined.
  11. Attributes:
  12. message -- explanation of the error
  13. """
  14. def __init__(self):
  15. super().__init__("When architecture is not intialized both student_architecture and teacher_architecture must be passed " "through **kwargs")
  16. class UnsupportedKDArchitectureException(KDModelException):
  17. """Exception raised for unsupported kd architecture.
  18. Attributes:
  19. message -- explanation of the error
  20. """
  21. def __init__(self, architecture):
  22. super().__init__("Unsupported KD architecture: " + str(architecture))
  23. class InconsistentParamsException(KDModelException):
  24. """Exception raised when values between arch_params/checkpoint_params should be equivalent.
  25. Attributes:
  26. message -- explanation of the error
  27. """
  28. def __init__(
  29. self,
  30. inconsistent_key1: str,
  31. inconsistent_key1_container_name: str,
  32. inconsistent_key2: str,
  33. inconsistent_key2_container_name: str,
  34. ):
  35. super().__init__(
  36. f"{inconsistent_key1} in {inconsistent_key1_container_name} must be equal to " f"{inconsistent_key2} in {inconsistent_key2_container_name}"
  37. )
  38. class UnsupportedKDModelArgException(KDModelException):
  39. """Exception raised for unsupported args that might be supported for Trainer but not for KDTrainer.
  40. Attributes:
  41. message -- explanation of the error
  42. """
  43. def __init__(self, param_name: str, dict_name: str):
  44. super().__init__(param_name + " in " + dict_name + " not supported for KD models.")
  45. class TeacherKnowledgeException(KDModelException):
  46. """Exception raised when teacher net doesn't hold any knowledge (i.e weights are the initial ones).
  47. Attributes:
  48. message -- explanation of the error
  49. """
  50. def __init__(self):
  51. super().__init__("Expected: at least one of: teacher_pretrained_weights, teacher_checkpoint_path or load_kd_trainer_checkpoint=True")
  52. class UndefinedNumClassesException(KDModelException):
  53. """Exception raised when num_classes is not defined for subnets (and cannot be derived).
  54. Attributes:
  55. message -- explanation of the error
  56. """
  57. def __init__(self):
  58. super().__init__("Number of classes must be defined in students and teachers arch params or by connecting to a dataset interface")
Discard
Tip!

Press p or to see the previous file or, n or to see the next file