diff --git a/ppcls/utils/ema.py b/ppcls/utils/ema.py index e41f472d6a1e448e76b922a718befbaa23d6ab51..b54cdb1b2030dc0a70394816a433e7e715e12996 100644 --- a/ppcls/utils/ema.py +++ b/ppcls/utils/ema.py @@ -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 diff --git a/ppcls/utils/misc.py b/ppcls/utils/misc.py index 90dc47e9bb7e6162ad921a14d24bc5467a415b62..08ab7b6f77cb85b0a822713ee7d573d561762d14 100644 --- a/ppcls/utils/misc.py +++ b/ppcls/utils/misc.py @@ -18,6 +18,7 @@ __all__ = ['AverageMeter'] class AverageMeter(object): """ Computes and stores the average and current value + Code was based on https://github.com/pytorch/examples/blob/master/imagenet/main.py """ def __init__(self, name='', fmt='f', postfix="", need_avg=True):