(self, x)
| 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() |
no test coverage detected