class_docstr: Base class for hooks.
  
  Hooks allow to inject behavior at different places of the training loop, which
  are listed below in the chronological order.
  
      on_start -> on_phase_start ->
          on_step -> on_phase_end -> on_end
  
  Deriving classes should call ``super().__init__()`` and store any state in
  ``self.state``. Any state added to this property should be serializable.
  E.g. -
  
  .. code-block:: python
  
      class MyHook(ClassyHook):
          def __init__(self, a, b):
              super().__init__()
              self.state.a = [1,2,3]
              self.state.b = "my_hook"
              # the following line is not allowed
              # self.state.my_lambda = lambda x: x^2
class_docstr_tok: ["Base","class","for","hooks",".","Hooks","allow","to","inject","behavior","at","different","places","of","the","training","loop",",","which","are","listed","below","in","the","chronological","order",".","on_start","-",">","on_phase_start","-",">","on_step","-",">","on_phase_end","-",">","on_end","Deriving","classes","should","call","``","super","(",")",".__init__","(",")","``","and","store","any","state","in","``","self.state","``",".","Any","state","added","to","this","property","should","be","serializable",".","E.g",".","-","..","code-block",":",":","python","class","MyHook","(","ClassyHook",")",":","def","__init__","(","self",",","a",",","b",")",":","super","(",")",".__init__","(",")","self.state.a","=","[","1,2,3","]","self.state.b","=","``","my_hook","''","#","the","following","line","is","not","allowed","#","self.state.my_lambda","=","lambda","x",":","x^2"]
docstr: Called at the end of each phase (epoch).
docstr_tok: ["Called","at","the","end","of","each","phase","(","epoch",")","."]
code: def on_phase_end(self, task) -> None:
      """Called at the end of each phase (epoch)."""
      pass
  
file_path: ClassyVision/classy_vision/hooks/classy_hook.py
imports: from abc import ABC, abstractmethod
  from typing import Any, Dict
  from classy_vision.generic.util import log_class_usage
label_desc: Use image node_id 8 for calling the ClassyHook obj's underlying member method code with example usage: obj.on_phase_end(task) without return types