什么时候停止训练神经网络? [英] When to stop training neural networks?

查看:2518
本文介绍了什么时候停止训练神经网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RNN进行特定领域的分类研究,并且已经积累了数以千万计的文本.由于要花费数天甚至数月才能运行整个数据集,因此我只选择了其中的一小部分进行测试,例如1M文本(用于培训的80%,用于验证的20%).我使用词向量化对整个语料库进行了预训练,并且还对模型应用了Dropout以避免过度拟合.当它在12小时内训练了60000条文本时,损失已经下降到相当低的水平,准确性为97%.我应该继续还是不继续?它有助于继续培训吗?

I'm trying to carry out a domain-specific classification research using RNN and have accumulated tens of millions of texts. Since it takes days and even months to run the whole dataset over, I only picked a small portion of it for testing, say 1M texts (80% for training, 20% for validation). I pre-trained the whole corpus with word vectorization and I also applied Dropout to the model to avoid over-fitting. When it trained 60000 text within 12 hrs, the loss had already dropped to a fairly low level with the accuracy 97%. Should I continue or not? Does it help continue with the training?

它仍在运行第一个纪元,我担心如果我现在停下来,该模型将无法覆盖全部...

It is still running the first epoch and I'm afraid if I stopped right now, the model wouldn't cover the whole...

推荐答案

作为一般的经验法则,您可能希望模型保持训练阶段,直到验证开始下降几个连续的迭代为止.在那之后,模型开始过度拟合数据.对于您的问题,由于训练模型需要很长时间,因此我建议您在第一个时期之后停止训练并测试模型,并确保代码中没有实现错误.如果模型的准确性可以接受,则可以再次对其进行训练.

Well as a general rule of thumb you may want let the model stay in training phase until the validation starts dropping for several consecutive iterations. After that point the model has strated to over-fit the data. For your problem, since it takes a very long time to train the model I suggest you stop the training after the first epoch and test the model and make sure there is no implementational bugs in your code. If the model has an acceptable accuracy then start training it again.

这篇关于什么时候停止训练神经网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆