dmlc / gluon-nlp

NLP made easy

Home Page:https://nlp.gluon.ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gluon-nlp/scripts/question_answering/train.py

rrjia opened this issue · comments

commented

Description

class ExponentialMovingAverage
in train.py the ema use two position:

if global_step == 1:
for name, param in model.collect_params().items():
ema.add(name, param.data(CTX[0]))

for name, param in model.collect_params().items():
ema(name, param.data(CTX[0]))

but model‘s params not update ,final we save model params as:

save model after train one epoch

    model.save_parameters(SAVE_MODEL_PREFIX_NAME +
                          time.asctime(time.localtime(time.time())))

is the ema not work?