Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About performance #3

Open
ZichaoHuang opened this issue Mar 17, 2017 · 17 comments
Open

About performance #3

ZichaoHuang opened this issue Mar 17, 2017 · 17 comments

Comments

@ZichaoHuang
Copy link
Contributor

ZichaoHuang commented Mar 17, 2017

Hi bxshi,
In gen_ht_r, it seems that you use both the validation set and test set to generate ht_r and tr_h. When I change it to use only the training set to generate ht_r and tr_h(I run ProjE_softmax.py as you recommended in the README file), filtered mean rank and hits@10 only reaches 74.3 and 0.675 after 12 iters, but according to the appendix in your AAAI paper, the model should yield filtered hits@10 over 0.8 around 12 iters.

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017 via email

@ZichaoHuang
Copy link
Contributor Author

But shouldn't we only use the training set during training? If we use the validation set and test set during training, how do we know if the model is overfitting or not?

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017 via email

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017

Hi I think there might be a problem, I'll look into that.

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017

Hi, please check data_generator_func, it took an input_queue from self.raw_training_data, which is the generated raw training data from self.__train_hr_t and self.__train_tr_h.

The tr_h and hr_t are used to filter out negative sampling results. This means we generate corrupted triples only if they never exists in the entire triple universe.

Hope this explanation helps.

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017

https://github.com/bxshi/ProjE/blob/master/ProjE_softmax.py#L546 uses hr_t and tr_h for evaluation so if you change them the model can not report accurate results.

@ZichaoHuang
Copy link
Contributor Author

ZichaoHuang commented Mar 17, 2017

Thanks for the explanation.
But when the data_generator_func function is called as a process target in main, model.hr_t and model.tr_h is also passed to the target as parameters.

@bxshi
Copy link
Owner

bxshi commented Mar 17, 2017

Hi I have updated the code. Now it does not use hr_t and tr_h to filter out negative examples.

@ZichaoHuang
Copy link
Contributor Author

Thanks for the updates.
I run the new ProjE model for over 25 epochs and it seems that the filtered hits@10 on test set converges around 0.782. Is that normal?

@bxshi
Copy link
Owner

bxshi commented Mar 18, 2017 via email

@ZichaoHuang
Copy link
Contributor Author

ZichaoHuang commented Mar 18, 2017

OK, thanks.

@760008522
Copy link

Hi,your experiments show relatively consistent performance using negative sampling rates as low as 25%.Which variable is represented negative sampling rates in the code?

@aaai18openkgc
Copy link

@760008522 the parameter is --neg_weight.

@760008522
Copy link

Hi,can you explain how to select negative samples? Which paragraph corresponds to the code?Thank you very much.

@bxshi
Copy link
Owner

bxshi commented Oct 25, 2017

@760008522 For example https://github.com/bxshi/ProjE/blob/master/ProjE_softmax_noweight.py#L313, the hr_tlist_weight is the masking weight which has a shape of [None, model.n_entity]. It is generated inside data_generator_func https://github.com/bxshi/ProjE/blob/master/ProjE_softmax_noweight.py#L425

@ocsponge
Copy link

@ZichaoHuang I also run the ProjE_softmax model for over 30 epochs and The result is below:
[VALID] ITER 30 [HEAD PREDICTION] MEAN RANK: 276.7 FILTERED MEAN RANK 81.4 HIT@10 0.412 FILTERED HIT@10 0.733
[VALID] ITER 30 [TAIL PREDICTION] MEAN RANK: 174.7 FILTERED MEAN RANK 59.6 HIT@10 0.497 FILTERED HIT@10 0.782
[TEST] ITER 30 [HEAD PREDICTION] MEAN RANK: 273.3 FILTERED MEAN RANK 80.5 HIT@10 0.416 FILTERED HIT@10 0.735
[TEST] ITER 30 [TAIL PREDICTION] MEAN RANK: 180.9 FILTERED MEAN RANK 60.0 HIT@10 0.494 FILTERED HIT@10 0.784

@AndRossi
Copy link

Hi @ocsponge, I have the same issue: my final result after training is about 10 points below the Hits@10 reported in the paper. I tried reducing the learning rate, but it didn't work.
Were you able to solve this issue in your environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants