GithubHelp home page GithubHelp logo

transe's People

Contributors

zichaohuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

transe's Issues

请教prediction

在evaluation中,得到了distance_tail_prediction和distance_head_prediction,transE原理是让正样本的距离尽可能小,但是在计算hit10时用了tf.nn.top_k找了距离最大的10个index,不应该是距离最小的10个吗?

Format of Input Dataset

What would be the input format for the files "train.txt" (assuming "test.txt" and "valid.txt" follow the same format as this one) , "entity2id.txt", "relation2id.txt"?
Is there any restriction for the kind of values accepted as entity labels?

run problem

-----Start evaluation-----
Traceback (most recent call last):
File "main.py", line 45, in
main()
File "main.py", line 40, in main
kge_model.launch_evaluation(session=sess)
File "D:\Python\TransE\src\model.py", line 153, in launch_evaluation
'out_queue': rank_result_queue}).start()
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\popen_spawn_win32.py", line 65, in init
reduction.dump(process_obj, to_child)
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.lock objects

(tensorflow) D:\Python\TransE\src>Traceback (most recent call last):
File "", line 1, in
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "D:\Python\Anaconda3\envs\tensorflow\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

sorry,I'm freshman.when used yuor code,I have problem as list.

是否存在内存泄露的问题?在每次eval时内存会增加

使用原始的train_wn18.sh训练时,每次eval时内存都会增加800MB左右的大小,是发生了内存泄露吗?
如果将eval_freq调小,应该可以显著观察到

环境是ubuntu18.04+tensorflow 1.13.0-rc0

我使用了tracemalloc观察内存,但没有发现异常之处

Evaluate rank seems wrong

In the evaluate method of model.py, the rank calculation seems wrong to me.

If I understand correctly, tf.nn.top_k(tf.reduce_sum(tf.abs(distance_head_prediction), axis=1), k=self.kg.n_entity) will return the entities that are furthest from the predicted head, instead of the closest. So shouldn't this line be

tf.nn.top_k(-tf.reduce_sum(tf.abs(distance_head_prediction), axis=1), k=self.kg.n_entity)

The result is too good to make me feel confused

I set embedding size =300, margin=4, epoch =2000, and I got the following result :
188.4303 | 52.74941 | 0.518122 | 0.815788

It is too good. This version of TransE can beat most of the TransE-based methods. Why?

image

And, your code is important to me, thanks!

thanks

dear author:
thank u for your code, it helps me a lot!

multiprocessing里面的joinablequeue卡住

运行sh train_fb15k.sh会在model.py第168行 eval_result_queue.join() 卡住,但是运行sh train_wn18.sh.sh没有任何问题。人为ctrl+c结束会显示
Traceback (most recent call last):
File "main.py", line 44, in
main()
File "main.py", line 40, in main
kge_model.launch_evaluation(session=sess)
File "/Users/shishang.zy/Desktop/Table/TransE-master/src/model.py", line 168, in launch_evaluation
eval_result_queue.join()
File "/anaconda3/lib/python3.6/multiprocessing/queues.py", line 305, in join
self._cond.wait()
File "/anaconda3/lib/python3.6/multiprocessing/synchronize.py", line 262, in wait
return self._wait_semaphore.acquire(True, timeout)
KeyboardInterrupt

filtering results

Hi there, thank you so much for your work, it is very helpful. But I just have a small question about your code. It seems like you didn't apply filter results(removing all the other correct entity from the ranking) in the evaluation part. Is that correct?

This may have a huge impact on the final result.

Hongming

rank of head entity in tail prediction

Taking a specific tail entity prediction task (s, p, ?) for example, is the head entity s always ranked 0 in idx_head_prediction[::-1]? I.e., is the most promising tail entity ranked as 1 in idx_head_prediction[::-1]?

Compute Head and Tail Prediction on FB15K dataset

I want to check the Prediction Head and Tail Predictions at (Hits@10) on different types of relation like 1-to-1, 1-to-N, N-to-1 and N-to-N of TransE model like the results mentioned in the paper. How can I perform the Head and Tail Prediction on 1-to-1, 1-to-N, N-to-1 and N-to-N of relations of FB15k dataset?

a question about hit@1

I run your code and print the result about hit@1, hit@3 and hit@10. It is so strange that your hit@1 is lower than other TransE. In KB2E, the raw hit@1 is 0.168069, and the filter hit@1 is 0.364274. The results in this code are 0.04 and 0.12. (The hyperparameters will not change the range.)
Thanks for your code and patience~ :)

问题

作者您好!我想问您一下您的TransE代码中model.py中的n_generator,n_rank_calculator和ckpt_dir分别表示什么意思

一点小问题

你好,再次感谢你的代码。有一个小地方没有看明白,在model.py的 launch_training函数中,存在
for _ in range(self.n_generator):
raw_batch_queue.put(None)
请问为什么要有这一句,是什么意思呢?
what is the 'Put (None)'means?
thank you

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.