Merge pull request #1399 from littletomatodonkey/r2.3/add_refer

[cherry-pick] add reference
This commit is contained in:
cuicheng01 2021-11-04 19:33:04 +08:00 committed by GitHub
commit d07f4fb529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

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

View File

@ -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):