Comments (13)
可能是eval_steps的问题。我没有加上在训练期间每隔一定时间做一次evaluation的代码,把它去掉试试吧。
from document-transformer.
多谢,可能确实是我额外加了eval_steps的关系。
另外,我想请教一下,在只使用文档级平行语料进行第二步的训练时,loss的波动感觉比较大,并且与base相比,即使loss下降了,但是在dev上的bleu也下降了。(我的句子级平行语料约300w,文档级平行语料约170w(句对)。在第一阶段训练基本transformer模型时在5.5w次达到dev最优bleu,并将其作为context模型的基准模型继续训练。)
请问,你在得到论文里有提升效果的最优模型,在context模型训练这一步大概是训练了多少轮次呢?
from document-transformer.
可以看一下学习率,如果是1的话可能太大了影响训练效果。通常来说应该loss会比较迅速地(几千轮内)降到比较低的值。我在200w句对上6w轮左右达到第一阶段dev最优,然后再训3w轮达到第二阶段dev最优
from document-transformer.
我用的是代码里默认的值(看到最新的merge将原来默认学习率从1改到了0.1),感觉loss确实是在几千轮就开始从2.7左右降到了1.7左右,但是后面会反复震荡,而且并不是loss最小的时候dev的结果最优,这也是正常的吗?
from document-transformer.
这个应该是正常的,和训练正常的NMT模型的情况差不多。
from document-transformer.
我用了自己的数据,基本重现了论文的结论,加入额外的上下文信息可以比不加涨约1-1.5个bleu。大神厉害!另外,我额外发现了一个有意思的事情,在评测test数据时我不小心用的是dev的上下文,我发现正确的上下文和不正确的上下文似乎对最终的结果没什么影响(大约0.1-0.2个bleu),这个你觉得可以怎么理解呢?
from document-transformer.
具体的原因我也说不准,只能猜测是模型学习到了一些特征,恰好dev和test上的这些特征比较相似。
from document-transformer.
你好,我看源码的时候发现一个和论文不太一致的地方,就是代码里是默认不使用context_gate的,使用的还是默认的残差连接,但论文里特意做了是否使用改进版残差连接的实验,证明还是使用好,那么为何在代码里又将其设置为false呢?这个是否和数据集相关,还是其实用不用差别不大,所以就默认不用了呢?(论文里对比实验是相差0.4个bleu)。另外,我发现代码里context_gate这部分的代码里注释掉了dropout,想和你请教一下缘由。
from document-transformer.
感谢提醒,我忘记把context_gate设成默认true了,已修正。另注释掉dropout其实是无意的。
from document-transformer.
好的,我还想确认一下细节,就是context_gate的实现细节里其实是调用了一个linear的层,这个层是否对应tf里的dense层呢?如果是的话,我用tf.layers.dense()替代的话,是否需要设置bias=False, activation=None呢?
from document-transformer.
抱歉回复晚了,看了下dense的说明,应该是的。
from document-transformer.
还想请教个问题,我在小规模数据(句子级300w,文档级170w)上测试该方法是有效的,与论文结论一致,可以增加1-2个点。但是如果句子级数据增加到2000w,在该模型基础上使用context框架学习额外的参数(还是使用那170w文档数据),结果bleu反而降了1-2个点,请问你在更大的数据集上验证过这个方法吗?
from document-transformer.
在句子级数据和文档级数据有数量级或的差异,或者是两者的topic存在差异时,只使用文档级的来做第二步训练确实会比较不稳定。我们没有在文档翻译这个任务上试过很大的数据集,但在大规模带有上下文信息的词语翻译(即源端和目标端是有歧义的词语,context端是包含该词语的完整句子)上验证有效。我们也发现,在训练时将完整的句子也放进第二步训练时(context端的内容=源端)会增加训练的稳定性。对应你这个情况,可以尝试将2000w的句子级别数据也放进第二步训练以增加稳定性。
from document-transformer.
Related Issues (14)
- 验证集上的 context 参数在哪里设置? HOT 2
- 源和目标必须是一对一吗?能否处理类似源句子数量为2,而目标句子数为1的这种情形? HOT 1
- loss为负数 HOT 2
- Dataset HOT 3
- Is this available in python 3 version? HOT 2
- 数据里的预处理 HOT 7
- Optimal training parameters HOT 1
- 关于IWSLT Fr-EN的参数设置 HOT 9
- abut train corpus format HOT 4
- about translate and decode HOT 1
- How to set parameters when use 940k ch-en corpus to train? HOT 1
- Would you please provide me the scripts of generating "context corpus"?
- context corpus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from document-transformer.