Skip to content

Commit

Permalink
use lerp in ema (#11442)
Browse files Browse the repository at this point in the history
  • Loading branch information
RangiLyu authored Feb 1, 2024
1 parent 76e23d2 commit 498295a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmdet/models/layers/ema.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ def avg_func(self, averaged_param: Tensor, source_param: Tensor,
"""
momentum = (1 - self.momentum) * math.exp(
-float(1 + steps) / self.gamma) + self.momentum
averaged_param.mul_(1 - momentum).add_(source_param, alpha=momentum)
averaged_param.lerp_(source_param, momentum)

0 comments on commit 498295a

Please sign in to comment.