fix ema reference

pull/1395/head
littletomatodonkey 2021-11-04 16:29:12 +08:00
parent cae027605c
commit 886856196e
1 changed files with 5 additions and 0 deletions
ppcls/utils

View File

@ -17,6 +17,11 @@ import numpy as np
class ExponentialMovingAverage():
"""
Exponential Moving Average
Code was heavily based on https://github.com/Wanger-SJTU/SegToolbox.Pytorch/blob/master/lib/utils/ema.py
"""
def __init__(self, model, decay, thres_steps=True):
self._model = model
self._decay = decay