mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
Merge pull request #1399 from littletomatodonkey/r2.3/add_refer
[cherry-pick] add reference
This commit is contained in:
commit
d07f4fb529
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user