Code Monkey home page Code Monkey logo

Comments (5)

Mrlyk423 avatar Mrlyk423 commented on August 26, 2024 1

你好,TransE训练中以下句子可能会在训练过程中使得内存增长:
while (ok[make_pair(j,fb_r[i])].count(fb_l[i])>0)
j=rand_max(entity_num);
该句子用于判断产生的负例是否和已有正例冲突,可以改为:
if (ok.count(make_pair(j,fb_r[i]))>0)
while (ok[make_pair(j,fb_r[i])].count(fb_l[i])>0)
j=rand_max(entity_num);

from kb2e.

cdzhan avatar cdzhan commented on August 26, 2024 1

嗯,问题解决了,谢谢你。另外,我觉得在while循环体内再加入一条判断语句
while (ok[make_pair(j,fb_r[i])].count(fb_l[i])>0)

j=rand_max(entity_num);
if (ok.count(make_pair(j,fb_r[i]))==0)
break;

是不是更好?

from kb2e.

zhangyi85 avatar zhangyi85 commented on August 26, 2024 1

我在windows环境下遇到过,查了半天没查出问题,在prepare过程中,有file f1,file f2open后,没有close,添加了两条close语句后,貌似内存泄漏的问题没出现了。

from kb2e.

Mrlyk423 avatar Mrlyk423 commented on August 26, 2024

对的。

from kb2e.

guotong1988 avatar guotong1988 commented on August 26, 2024

代码里的fb是freebase的意思吧?

from kb2e.

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.