otiliastr / coper Goto Github PK
View Code? Open in Web Editor NEWContextual Parameter Generation for Knowledge Graph Link Prediction
Contextual Parameter Generation for Knowledge Graph Link Prediction
When I execute command —— !cd coper-master/CoPER_MINERVA/ && bash ./experiment.sh configs/umls.sh --inference 0
error occurs:
Memory allocated before eval data loading: 1.02944768
HIIIII
652 triples loaded from data/umls/dev.triples
661 triples loaded from data/umls/test.triples
Memory allocated after eval data loading: 1.02944768
0% 0/326 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 830, in
run_experiment(args)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 813, in run_experiment
inference(lf)
File "/content/coper-master/CoPER_MINERVA/src/experiments.py", line 369, in inference
pred_scores = lf.forward(dev_data, verbose=False)
File "/content/coper-master/CoPER_MINERVA/src/learn_framework.py", line 253, in forward
pred_score = self.predict(mini_batch, verbose=verbose)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pg.py", line 226, in predict
pn, e1, r, e2, kg, self.num_rollout_steps, self.beam_size)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/beam_search.py", line 168, in beam_search
pn.update_path(action, kg, offset=action_offset)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 257, in update_path
offset_path_history(self.path, offset)
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 235, in offset_path_history
new_tuple = tuple([_x[offset, :, :] for _x in x])
File "/content/coper-master/CoPER_MINERVA/src/rl/graph_search/pn.py", line 235, in
new_tuple = tuple([_x[offset, :, :] for _x in x])
IndexError: tensors used as indices must be long, byte or bool tensors
type of elements in offset is float, how can I solve it, anyone can help
Hi
From Appendix A, it seems to me that if (s, r, o) exists in test, then o is never chosen as a negative sample for any train triple (s,r,o'). This means that during training you have already seen into test data.
Am I missing something, or is this what is happening?
Hi
As pointed out by @LinXueyuanStdio in #6 , during evaluation, scores are only calculate in one direction: h, r
to t
. This results in unusually high scores (for eg. they get very high scores with TransE, a 2013 model), for both Coper as well as baselines, and hence these numbers cannot be compared with other papers (almost all papers use the average of head and tail prediction).
Do you have numbers with the correct evaluation as well, ie both head and tail prediction averaged?
Thanks
Hi , i found the result of convE on the FB15k-237 is 60.83(Hits@10) in the Table 1 of your paper, However the result is 0.501 in the original paper: 'Convolutional 2D Knowledge Graph Embeddings'.
Is there anything I ignored? If so, please point it out.
best.
Hi, I want to know where can I get the code for FB15k-237 t-SNE implementation? I want to visualize some datasets. Thank you very much.
May I ask you about the implementation of the Heatmap of pairwise cosine similarities between relation embedding? I'd like to reproduce this procedure such as “type” assignment?
Dear Prof:
I can't get the result of CoPER-ConvE on the dataset WN18RR. The parameters I used during the training process are just the parameters from the source file named 'config_WN18RR_cpg.yaml'.
If there is something I missed, could you please point it out? Thanks a lot.
Hello @otiliastr , thanks for sharing your nice code! Your job has inspired me a lot. I love it.
I run the code in CoPER_ConvE, and I have got ~60% of ConvE and ~62% of CoPER-ConvE on the FB15k-237 (hits@10).
Everything is OK.
However , when I rewrite it using PyTorch, I can only get ~50% of ConvE and ~53% of CoPER-ConvE on the FB15k-237 (hits@10).
I have read the paper carefully. And I have implemented the negative sampling the same as the paper said. But it shows that the negative sampling takes no effect. It keeps ~53% of CoPER-ConvE on the FB15k-237 (hits@10) with and without negative sampling.
So I believe the negative sampling strategy is not the key trick.
It is very very very strange that I can reproduce the result which is written by Tensorflow1.x while I couldn't reproduce it by PyTorch!
I will appreciate it if you can give more advice.
How I implement negative sampling:
BatchSize x SamplingWindowSize
and target scores matrix of the same shape as target ids.{ (1,1,2),(1,1,3),(2,1,3) }
, entity set {1,2,3,4}
, relation set {1,2}
, the sample is[ [2,3,4], [3,1,2] ]
, target scores=[ [1,1,0], [1,0,0] ]
for batch [ [1,1], [2,1] ]
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.