class_docstr: Mean Teacher Hook.
  
  Mean Teacher is an efficient semi-supervised learning method in
  `Mean Teacher <https://arxiv.org/abs/1703.01780>`_.
  This method requires two models with exactly the same structure,
  as the student model and the teacher model, respectively.
  The student model updates the parameters through gradient descent,
  and the teacher model updates the parameters through
  exponential moving average of the student model.
  Compared with the student model, the teacher model
  is smoother and accumulates more knowledge.
  
  Args:
      momentum (float): The momentum used for updating teacher's parameter.
          Teacher's parameter are updated with the formula:
         `teacher = (1-momentum) * teacher + momentum * student`.
          Defaults to 0.001.
      interval (int): Update teacher's parameter every interval iteration.
          Defaults to 1.
      skip_buffers (bool): Whether to skip the model buffers, such as
          batchnorm running stats (running_mean, running_var), it does not
          perform the ema operation. Default to True.
class_docstr_tok: ["Mean","Teacher","Hook",".","Mean","Teacher","is","an","efficient","semi-supervised","learning","method","in","`","Mean","Teacher","<","https",":","\/\/arxiv.org\/abs\/1703.01780",">","`","_",".","This","method","requires","two","models","with","exactly","the","same","structure",",","as","the","student","model","and","the","teacher","model",",","respectively",".","The","student","model","updates","the","parameters","through","gradient","descent",",","and","the","teacher","model","updates","the","parameters","through","exponential","moving","average","of","the","student","model",".","Compared","with","the","student","model",",","the","teacher","model","is","smoother","and","accumulates","more","knowledge",".","Args",":","momentum","(","float",")",":","The","momentum","used","for","updating","teacher","'s","parameter",".","Teacher","'s","parameter","are","updated","with","the","formula",":","`","teacher","=","(","1-momentum",")","*","teacher","+","momentum","*","student","`",".","Defaults","to","0.001.","interval","(","int",")",":","Update","teacher","'s","parameter","every","interval","iteration",".","Defaults","to","1.","skip_buffers","(","bool",")",":","Whether","to","skip","the","model","buffers",",","such","as","batchnorm","running","stats","(","running_mean",",","running_var",")",",","it","does","not","perform","the","ema","operation",".","Default","to","True","."]
code: def __init__(
      self, momentum: float = 0.001, interval: int = 1, skip_buffer=True
  ) -> None:
      assert 0 < momentum < 1
      self.momentum = momentum
      self.interval = interval
      self.skip_buffers = skip_buffer
  
file_path: mmdetection/mmdet/engine/hooks/mean_teacher_hook.py
imports: from typing import Optional
  import torch.nn
  from mmengine.hooks import Hook
  from mmengine.model import is_model_wrapper
  from mmengine.runner import Runner
  from mmdet.registry import HOOKS
label_desc: Use image node_id 1 to create a new MeanTeacherHook object from inherited base classes: Hook with example: obj = MeanTeacherHook(momentum, interval, skip_buffer)