Git Product home page Git Product logo

Comments (12)

JasonForJoy avatar JasonForJoy commented on June 12, 2024

@gyl1993
大概在60k-70k steps。

from imn.

gyl1993 avatar gyl1993 commented on June 12, 2024

好的,看到代码中指标MRR不再增加,模型就不会更新了,我现在训练的模型虽然最终跑了大约70k steps,但是在23k steps之后,MRR不再增加,模型就没再更新了,请问模型是否更新,要参考指标MRR吗?还是直接训练60k-70k steps,不管MRR,得到最终模型?

from imn.

JasonForJoy avatar JasonForJoy commented on June 12, 2024

@gyl1993
模型是否更新需要参考指标MRR。在我们的实验设定下,我们只保存MRR最高的模型,如果后续“train-and-evaluate”产生了MRR更高的模型,我们保存更新最新的模型。
不同数据集的收敛步数不完全一致,Ubuntu V1和V2收敛速度相对慢一些,大概需要60k-70k steps,Douban和Ecommerce收敛速度相对快一些,大概需要50k-60k steps。同时,Douban和Ecommerce的训练波动较大,不同的随机初始化会导致有时在30k就收敛不再提高,有时在50k。在我们的实验设定中,我们相同的参数跑4组实验,取最高。

from imn.

gyl1993 avatar gyl1993 commented on June 12, 2024

好的,非常感谢!

from imn.

bringtree avatar bringtree commented on June 12, 2024

你好, @JasonForJoy 大神,想问下豆瓣数据集训练上是需要有什么技巧吗, 我用里面的脚本跑完只有0.249 离0.262 还有较大的差距。


Evaluation:
16000
32000
48000
num_test_samples: 50001  test_accuracy: 0.853482930351
Accuracy: 0.853482930341, Precision: 0.857402839002  Recall: 0.848006079757  F1: 0.852678571428 Loss: 0.822119040656
MAP (mean average precision: 0.96756    MRR (mean reciprocal rank): 0.96756     Top-1 precision: 0.93512        Num_query: 25000
2019-12-21T20:35:56.470165: step 77100, loss 0.0189399, acc 0.992188
2019-12-21T20:37:50.448667: step 77200, loss 0.0258851, acc 0.992188
2019-12-21T20:39:44.184259: step 77300, loss 0.0470009, acc 0.984375
2019-12-21T20:41:38.089496: step 77400, loss 0.0186537, acc 0.992188
2019-12-21T20:43:31.725028: step 77500, loss 0.0618175, acc 0.96875
2019-12-21T20:45:26.720671: step 77600, loss 0.0174854, acc 0.992188
2019-12-21T20:47:19.993582: step 77700, loss 0.0263885, acc 0.984375
2019-12-21T20:49:13.672541: step 77800, loss 0.0128442, acc 0.992188
2019-12-21T20:51:06.746916: step 77900, loss 0.0891091, acc 0.96875
2019-12-21T20:53:00.270162: step 78000, loss 0.0374018, acc 0.976562

Evaluation:
16000
32000
48000
num_test_samples: 50001  test_accuracy: 0.853762924703
Accuracy: 0.853762924742, Precision: 0.862761986793  Recall: 0.841366345346  F1: 0.851929852982 Loss: 0.779464164632
MAP (mean average precision: 0.96706    MRR (mean reciprocal rank): 0.96706     Top-1 precision: 0.93412        Num_query: 25000
2019-12-21T20:57:45.108943: step 78100, loss 0.019216, acc 0.992188

num_query = 667
recall@1 = 0.249134956331
recall@2 = 0.418249208729
recall@5 = 0.77689488589

from imn.

JasonForJoy avatar JasonForJoy commented on June 12, 2024

@bringtree
开源的code就是我们实验中所使用的,是完全可以复现我们论文中的结果的。
非要说什么技巧的话,因为Douban和Ecommerce的开发集较小(Ubuntu V1开发集有500k pairs, Ubuntu V2 195k pairs, Douban 50k pairs, Ecommerce 10k pairs)。
因此相同配置下Douban和Ecommerce的训练波动相比较Ubuntu较大,不同的随机初始化会导致有时在30k就收敛,有时在50k收敛。
从实验结果上来讲,训练steps更多才收敛的模型,测试出来的结果更好。

from imn.

gyl1993 avatar gyl1993 commented on June 12, 2024

@JasonForJoy
请问Douban训练的参数是开源代码中设置的那样吗?如果只保存MRR最高的模型,我的在训练15k~25k steps模型就停止更新了,使用了多次不同的随机初始化,结果都差不多。

from imn.

bringtree avatar bringtree commented on June 12, 2024

@JasonForJoy
请问Douban训练的参数是开源代码中设置的那样吗?如果只保存MRR最高的模型,我的在训练15k~25k steps模型就停止更新了,使用了多次不同的随机初始化,结果都差不多。

你好, 我想问下你的recall@1 大概是多少,我今天训练了一份只剩下0.247999809619了。

                if valid_mrr > best_mrr:
                    best_mrr = valid_mrr
                    test_mrr = test_step()
                    path = saver.save(sess, checkpoint_prefix, global_step=current_step)
                    print("Saved model checkpoint to {}\n".format(path))

代码中确实是指保存最佳的MRR,另外豆瓣中的dropout_keep_prob 在训练过程是被设置1的,也就是不用dropout的.

from imn.

JasonForJoy avatar JasonForJoy commented on June 12, 2024

@gyl1993 @bringtree
在我们的实验中,在Douban这个数据集上,我们实验发现dropout设置为0.8和dropout设置为1,最终的结果差别不大。但dropout设置为0.8时,自然迭代的steps更多,最终结果也更稳定一些。

from imn.

bringtree avatar bringtree commented on June 12, 2024

@JasonForJoy 谢谢,我今天跑出个和你paper基本相同的结果了。 膜拜下大神。

from imn.

bringtree avatar bringtree commented on June 12, 2024

@JasonForJoy 大神,我还想请教一个关于数据集的问题,大神在跑EDC数据集的时候有没有感觉实验结果波动有点大,我在你的模型的基础上修改了一些结构,结果同样的参数,训练步数, 我第一次训练有recall@1 0.612,第二次训练就 0.644,第三次训练次0.634 。 感觉实验的方差有点大(感觉是开发集和测试集有点小?)。你在跑IMN的时候有遇到这样的问题吗?是怎么处理的呢

from imn.

JasonForJoy avatar JasonForJoy commented on June 12, 2024

@bringtree
在Douban和Ecommerce上确实都会存在实验结果方差较大的情况,这是由于其开发集和测试集较小的缘故,在所难免。
从实验结果上来讲,我们发现如果在开发集上取得差不多的结果,一般训练steps更多才收敛的模型,测试出来的结果更好。
如果为了让模型更稳定,建议可以尝试增大dropout。起初增大dropout会让模型性能提升,继续增大的话性能无法进一步提升,同时会需要更多的迭代步数来达到最佳性能,但这样的模型往往在测试集上更趋向稳定。

from imn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.