dmlc / gluon-nlp

NLP made easy
https://nlp.gluon.ai/
Apache License 2.0
2.56k stars 535 forks source link

gluon-nlp/scripts/question_answering/train.py #1569

Open rrjia opened 3 years ago

rrjia commented 3 years ago

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?

leezu commented 3 years ago

There is no train.py in https://github.com/dmlc/gluon-nlp/tree/master/scripts/question_answering or https://github.com/dmlc/gluon-nlp/tree/v0.x/scripts/question_answering

Please provide a link to the code you're concerned about. Thanks

rrjia commented 3 years ago

code link is : https://github.com/dmlc/gluon-nlp/blob/qanet/scripts/question_answering/train.py

appreciate for your supprot.