MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / update

Method update

PATH/core/clipping.py:82–93  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

80 return self.get_mean() * (1+self.thresh)
81
82 def update(self, x):
83 if self.init:
84 self.val = x
85 self.init = False
86 mean = self.get_mean()
87 if self.min_max:
88 x = max(min(x, mean*(1+self.thresh)), mean*(1-self.thresh))
89 else:
90 x = min(x, mean*(1+self.thresh))
91
92 self.val = self.mom * self.val + (1-self.mom)*x
93 return self.get_clip_val()

Callers 2

vreduceFunction · 0.45
clip_grad_norm_Function · 0.45

Calls 2

get_meanMethod · 0.95
get_clip_valMethod · 0.95

Tested by

no test coverage detected