LinXueyuanStdio / LaTeX_OCR_PRO

:art: 数学公式识别增强版:中英文手写印刷公式、支持初级符号推导(数据结构基于 LaTeX 抽象语法树)Math Formula OCR Pro, supports handwrite, Chinese-mixed formulas and simple symbol reasoning (based on LaTeX AST).
GNU General Public License v3.0
1.1k stars 235 forks source link

训练无法达到预期 #9

Closed jitingcn closed 4 years ago

jitingcn commented 4 years ago

最近使用完整数据集训练了两次,都在300epoch左右达到了相对最高的指标,ExactMatchScore在11左右,EditDistance和BLEU-4在70左右,之后继续训练分数反而在不断降低,想问一下是不是有什么地方出了问题 tensorboard loss图表如下(smooth 0.97) image

LinXueyuanStdio commented 4 years ago

过拟合

自己调一下参,batchsize取1,learningrate取0.1开始,试试。

jitingcn commented 4 years ago

调节到1e-5之后效果不错,就是对decay的设置还有点不明白

INFO: Epoch 290/600
INFO: - Training:  - 397s - perplexity: 1.242942 - lr: 0.000010 - loss: 0.171819
INFO: - Eval:  perplexity is -1.20  ||  BLEU-4 is 87.45  ||  EditDistance is 91.30  ||  ExactMatchScore is 36.78 
INFO: - New best score (20.36)!
CaiHandsome commented 4 years ago

调节到1e-5之后效果不错,就是对decay的设置还有点不明白

INFO: Epoch 290/600
INFO: - Training:  - 397s - perplexity: 1.242942 - lr: 0.000010 - loss: 0.171819
INFO: - Eval:  perplexity is -1.20  ||  BLEU-4 is 87.45  ||  EditDistance is 91.30  ||  ExactMatchScore is 36.78 
INFO: - New best score (20.36)!

您好,这是我的参数设置,已经将lr设置为了1e-5 { "export_name": "training.json", "device": "cuda:3", "criterion_method": "CrossEntropyLoss", "n_epochs": 600, "batch_size": 1, "dropout": 0.99, "clip": -1, "lr_method": "adam", "lr_scheduler": "CosineAnnealingLR", "lr_init": 1e-3, "lr_min": 1e-5, "start_decay": 6, "end_decay": 13, "lr_warm": 1e-4, "end_warm": 0 } 训练时EM值始终为0,可以帮忙看一下问题出在哪里了吗?

LinXueyuanStdio commented 4 years ago

从这个配置没问题,可能是训练时间短?一般要6小时左右才可以看到EM显著增加,在这之前的很长一段时间,只能看到perplexity在变

CaiHandsome commented 4 years ago

从这个配置没问题,可能是训练时间短?一般要6小时左右才可以看到EM显著增加,在这之前的很长一段时间,只能看到perplexity在变

感谢大佬回复。 我训练结束后:

gittjob commented 2 years ago

调节到1e-5之后效果不错,就是对衰减的设置还有点不明白

INFO: Epoch 290/600
INFO: - Training:  - 397s - perplexity: 1.242942 - lr: 0.000010 - loss: 0.171819
INFO: - Eval:  perplexity is -1.20  ||  BLEU-4 is 87.45  ||  EditDistance is 91.30  ||  ExactMatchScore is 36.78 
INFO: - New best score (20.36)!

你好,最后效果训练出来吗? 可以分享一下经验吗,提前谢谢你。