takuo-h / GNN-for-OOKB

40 stars 17 forks source link

how to achieve the accuracy in the paper #2

Open xiayto opened 6 years ago

xiayto commented 6 years ago

Thank you for your paper and code I run the code with the settings the same as the paper's.But the accuracy is only about 60%. Is it anything wrong with my settings? my settings is: pooling_method:avg batch_size=5000 epoch_size=300 a1=0.01 a2=0.0001 Other settings are the same as the default settings,and I've also try the settings all are default settings.But both of them the accuracy is about 60%. How can I achieve the accuracy in the paper? Could u help me?

takuo-h commented 6 years ago

Please give me all your options in the model . (main.py prints your options or ArgumentParser before main function)

xiayto commented 6 years ago

Namespace(activate='tanh', alpha0=0, alpha1=0.01, alpha2=0.0001, alpha3=0, auxiliary_file='dataset/standard/WordNet11/serialized/train', batch_size=5000, beta0=0.01, beta1=0.001, dev_file='dataset/standard/WordNet11/serialized/dev', dim=200, dropout_block=0.05, dropout_decay=0.0, dropout_embed=0.0, entity_size=18, epoch_size=300, gpu_device=0, is_balanced_dev=False, is_balanced_tr=True, is_batchnorm=False, is_bernoulli_trick=False, is_bound_wr=False, is_embed=True, is_known=True, is_residual=False, layerR=1, margin_file='WN11_3', nn_model='I', object_kind=1, opt_model='Adam', order=1, param_dir='', pool_size=640, pooling_method='avg', rel_size=10, sample_size=64, seed=0, test_batch_size=64, test_file='dataset/standard/WordNet11/serialized/test', threshold=1.0, train_file='dataset/standard/WordNet11/serialized/train', train_size=1000, use_gpu=True) main.py -g -mF WN11_3 16:24:57 load train 16:24:58 set axiaulity 16:24:58 standard setting, use: edges=links 16:24:58 load dev dev size: 4877 16:24:58 load test test size: 19706 relation size: 11 entity size: 38194

takuo-h commented 6 years ago

thank you. try object_kind = 2 (i.e., -oK 2 ). and I recommend to use more large thresholds like (100 or 300) .

xiayto commented 6 years ago

thank you very much! I will try.

xiayto commented 6 years ago

I am very sorry to trouble you again. I have modified the parameter and the performance up to 70%. But still can't achieve the ideal accuracy. I want to ask for your help.

Namespace(activate='tanh', alpha0=0, alpha1=0, alpha2=0, alpha3=0, auxiliary_file='dataset/standard/WordNet11/serialized/train', batch_size=5000, beta0=0.01, beta1=0.0001, dev_file='dataset/standard/WordNet11/serialized/dev', dim=200, dropout_block=0.05, dropout_decay=0.0, dropout_embed=0.0, entity_size=38194, epoch_size=300, gpu_device=0, is_balanced_dev=False, is_balanced_tr=True, is_batchnorm=True, is_bernoulli_trick=False, is_bound_wr=False, is_embed=True, is_known=True, is_residual=False, layerR=1, margin_file='WN11_8', nn_model='I', object_kind=2, opt_model='Adam', order=1, param_dir='', pool_size=640, pooling_method='avg', rel_size=11, sample_size=64, seed=0, test_batch_size=5000, test_file='dataset/standard/WordNet11/serialized/test', threshold=300.0, train_file='dataset/standard/WordNet11/serialized/train', train_size=1000, use_gpu=True) main.py -g -mF WN11_8 20:18:24 load train 20:18:25 set axiaulity 20:18:25 standard setting, use: edges=links 20:18:26 load dev dev size: 4877 20:18:26 load test test size: 19706 relation size: 11 entity size: 38194

Is there any problems with my parameters? Can I know the parameters of your example?

takuo-h commented 6 years ago

OK, I'll try it. But, please give me time. In particular, I'll do after 12/15.

takuo-h commented 6 years ago

I (1)changed default parameters and (2) added log-example. (1)Please re-download this repository and try it again. (2)the log-example just contains logs in 0<=epoch<20. but it shows over 80% accuracies. keep training may improve it (at least 87%). tune thresholds using dev results and the achieve the sota score. thank you .(and maybe i can't pay attention for this codes for a while. sorry for my poor capacity.)

xiayto commented 6 years ago

Thank you.It is appreciated for all you did

xiayto commented 6 years ago

thank you very much! I have achieved the accuracy. I found a problem, but it's probably because I didn't fully understand it. I know you are busy, I want you can have a look when you have time.

In modelA0 ,line 163: else: size = len(rx) rx = F.concat(rx,axis=0) if r%2==0: rx = getattr(self,self.forwardH[r//2][0])(rx) else: rx = getattr(self,self.forwardT[r//2][0])(rx) rx = F.split_axis(rx,size,axis=0) for i,x in enumerate(rx): result[assignR[(r,i)]] = x

This is to calculate the ArV(A is the matrix related to relations, V is the neighbors' embeddings) result is the list of ArV. However each V not only connected to a single relation, for example for V1: Ar1V1, Ar2V1...... but there is only one ArV1 in result list. When pooling it may cause some mistakes.

is this to simplify the calculation? or is there a mistake in my understanding? I'm very sorry to disturb you, I hope you can help me when you have time, thank you very much!

takuo-h commented 6 years ago

Thank you for your report. I appreciate your attention. I'll fix it.