TimDettmers / ConvE

Convolutional 2D Knowledge Graph Embeddings resources
MIT License
674 stars 163 forks source link

Changing embedding size fails (line numbers in Quirks section are not right) #53

Closed unmeshvrije closed 5 years ago

unmeshvrije commented 5 years ago

Sorry but I could not follow this description

If you use a different embedding size, the ConvE concatenation size cannot be determined automatically and you have to set it yourself in line 106/107. Also the first dimension of the projection layer will change. You will need to comment out the print function (line 118) to get the needed dimension, and adjust the size of the fully connected layer in line 98

I could not follow this explanation (lines 106/107, 98, 118 of which files ?) If I want to change the embedding size to say 50, how many places I have to make the change ?

TimDettmers commented 5 years ago

My implementation is a bit unfortunate. I should have made it possible to change the embedding size more easily. I left it open so one can use a different kind of shapes to concatenate the embeddings.

The file that you are looking for the is the model.py file. The lines have been changed since I modified the model.py file. You need to change the shape of the embeddings in Line 103/104; the fully connected layer size in Line 95.

I think since I implemented it, PyTorch has improved the error messages and it should be clear which dimension is needed here. It is difficult to say which is the hidden dimension for the fully connected layer to line everything up, so you can uncomment Line 115 to see what kind of dimension you need.

unmeshvrije commented 5 years ago

Thanks for the response @TimDettmers . I am using your implementation on LUBM benchmark and a subset of YAGO-2. If I have questions about the paper, may I send you an email ?

TimDettmers commented 5 years ago

Sure! I am always happy to answer more questions!

TimDettmers commented 5 years ago

I change the description in c8aa06cf8c7c7e6b50199e5ea49d07699ba9ec40.