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

NameError: name 'eps' is not defined #2

Open
Barrnett opened this issue Oct 30, 2020 · 3 comments
Open

NameError: name 'eps' is not defined #2

Barrnett opened this issue Oct 30, 2020 · 3 comments

Comments

@Barrnett
Copy link

你好,感谢开源C2L网络,我在运行的时候遇到了一个问题,NCE文件夹里面的NCECriterion.py文件的57行log_D1 = torch.div(P_pos, P_pos.add(m * Pn + eps)).log_()中的“eps”变量是如何得到的?

@funnyzhou
Copy link
Owner

Sorry for my late reply.

In fact, I did not meet this problem when running my code. I suggest you to set eps to a very small value, such as 1e-6.

Hope it can help you.

@lihuaqingliii
Copy link

你好,感谢开源C2L网络,我在运行的时候遇到了一个问题,NCE文件夹里面的NCECriterion.py文件的57行log_D1 = torch.div(P_pos, P_pos.add(m * Pn + eps)).log_()中的“eps”变量是如何得到的?

您好,我也遇见了同样的问题,请问您是怎么解决的呀

@TIanCat
Copy link

TIanCat commented Dec 5, 2022

你好,感谢开源C2L网络,我在运行的时候遇到了一个问题,NCE文件夹里面的NCECriterion.py文件的57行log_D1 = torch.div(P_pos, P_pos.add(m * Pn + eps)).log_()中的“eps”变量是如何得到的?

遇到了同样的问题,按照作者建议,使用1e-6代替了。此外代码中的n_data怎么理解呢?每个epoch迭代的次数吗?还是总数据量,C2L代码中写len(train_dataset),PCRL写len(train_dataloader),希望作者能够解答一下,谢谢

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

4 participants