class_docstr: Use 2-norm of gradient to judge whether converge or not.
class_docstr_tok: ["Use","2-norm","of","gradient","to","judge","whether","converge","or","not","."]
code: def is_converge(self, delta_weight, weight=None):
      weight_diff = self.compute_weight_diff(delta_weight)
      if weight is None:
          # avoid tensor[bool]
          if weight_diff < self.eps:
              return True
          return False
      if self.pre_weight is None:
          self.pre_weight = weight
          return False
      if weight_diff < self.eps * max(
          [torch.linalg.norm(weight, 2), 1]
      ):
          return True
      return False
  
file_path: FATE/python/fate/ml/utils/_convergence.py
imports: import logging
  import torch
label_desc: Use image node_id 4 for calling the _WeightDiffConverge obj's underlying member method code with example usage: obj.is_converge(delta_weight, weight) and returns: False, False, False, True, True