Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教Fast-PTransE代码中的一些问题 #45

Open
ngl567 opened this issue Nov 3, 2018 · 0 comments
Open

请教Fast-PTransE代码中的一些问题 #45

ngl567 opened this issue Nov 3, 2018 · 0 comments

Comments

@ngl567
Copy link

ngl567 commented Nov 3, 2018

在ptranse.cpp 中,有一些地方实在看不明白,希望麻烦解答下:

  1. 在randn函数中,dScope=rand(0.0,normal(miu,miu,sigma));的作用是什么?整个randn()函数实现的是什么功能?
  2. 在gradient_path()函数中,relationVec[r1* dimension + ii]+=belta*ptranseAlpha*x;我在算梯度时感觉应该是relationVec[r1 * dimension + ii]-=belta*ptranseAlpha*x;同样,relationVec[j * dimension + i]-=belta*ptranseAlpha*x;我觉得应该是relationVec[j * dimension + ii]+=belta*ptranseAlpha*x;。不知道这个是不是我计算有问题,麻烦查看下,谢谢。
  3. pransetrainMode() 函数中, if (randd(id) % 1000 < pr)表示什么意思?pr_path = 0.99*pr_path + 0.01;为什么要做这个操作?train_path(trainList[i]->r, j, relPath, 2*margin, pr*pr_path);中为什么要用2*margin而不是margin?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant