zqhead / transe Goto Github PK
View Code? Open in Web Editor NEWreimplement TransE Mode
reimplement TransE Mode
你好!
关于在TransE_pytorch中的 hpt 和 tph, 文件中的注释是这样说的:"这里关于p的说明 tph 表示每一个头结对应的平均尾节点数 hpt 表示每一个尾节点对应的平均头结点数"。而关于hpt和tph的代码是这一段`
for r_ in relation_head:
sum1, sum2 = 0, 0
for head in relation_head[r_]:
sum1 += 1
sum2 += relation_head[r_][head]
tph = sum2 / sum1
relation_tph[r_] = tph
for r_ in relation_tail:
sum1, sum2 = 0, 0
for tail in relation_tail[r_]:
sum1 += 1
sum2 += relation_tail[r_][tail]
hpt = sum2 / sum1
relation_hpt[r_] = hpt`
以tph的代码为例,这里的sum1是关系r_对应的头结点数,而sum2似乎并非是关系r_对应的尾结点数,而应该是关系r_与头结点的连接数,当然,这与关系r_与尾结点的连接数是一样的,但是不管怎样,我认为sum2不应该是关系r_对应的尾节点数。这和下文注释中的表达是矛盾的。
你好我想问下,如果我想用这个模型训练FB5M数据集,想得到entity.bin和relation.bin文件怎么做?
At first this is a amazing code work! and after running the code, the code showed the error that the 'WN18_torch_TransE_entity_50dim_batch4800' file can not be found, and i cannot find it in the whole file of the TransE file.
FileNotFoundError: [Errno 2] No such file or directory: 'WN18_torch_TransE_entity_20dim_batch400'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.