From d970f04d1c3881d894cfcf3066cd0e82509a0ec3 Mon Sep 17 00:00:00 2001 From: MichSchli Date: Mon, 6 Mar 2017 23:34:05 +0100 Subject: [PATCH] Implemented complex --- .idea/workspace.xml | 289 ++--- backward.rels | 1345 +++++++++++++++++++++++ code/common/model_builder.py | 3 + code/decoders/complex.py | 105 ++ code/encoders/message_gcns/gcn_basis.py | 10 +- code/tools/cluster.py | 6 +- code/tools/ensemble.py | 16 +- code/train.py | 4 +- forward.rels | 1345 +++++++++++++++++++++++ run-train.sh | 2 +- settings/complex.exp | 28 + settings/gcn_basis.exp | 8 +- 12 files changed, 3016 insertions(+), 145 deletions(-) create mode 100644 backward.rels create mode 100644 code/decoders/complex.py create mode 100644 forward.rels create mode 100644 settings/complex.exp diff --git a/.idea/workspace.xml b/.idea/workspace.xml index cb32e9a..0f615e9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,12 +2,15 @@ - + + - + + + + - @@ -505,17 +510,17 @@ - - - + - + - + + + + - @@ -536,23 +541,6 @@ @@ -806,9 +811,6 @@ - - - @@ -976,23 +978,6 @@ - - - - - - - - - - - - - - - - - @@ -1000,20 +985,10 @@ - - - - - - - - - - @@ -1021,7 +996,6 @@ - @@ -1029,7 +1003,6 @@ - @@ -1037,7 +1010,6 @@ - @@ -1045,7 +1017,6 @@ - @@ -1053,45 +1024,45 @@ - - + - - + - + - - - + + + + + - - + + - + @@ -1099,8 +1070,8 @@ - - + + @@ -1109,24 +1080,74 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + diff --git a/backward.rels b/backward.rels new file mode 100644 index 0000000..51296fb --- /dev/null +++ b/backward.rels @@ -0,0 +1,1345 @@ +0.145569 -0.0560113 +0.00293866 0.0800942 +0.0526576 0.569259 +-0.0147952 0.275111 +-0.0194505 -0.223652 +-0.0213965 -0.0232622 +-0.0994677 -0.125856 +0.270764 0.122944 +0.130908 0.0281224 +-0.0519921 0.0269926 +-0.585124 -0.13345 +0.529286 0.302016 +0.246581 -0.281921 +-0.211901 0.48707 +0.145748 -0.120284 +0.614771 -0.129935 +1.42043 0.0852041 +-0.120048 -0.174505 +0.10967 -0.105379 +0.0356853 -2.08742 +0.694889 0.0856403 +-0.100268 -0.0190947 +0.0668436 -0.0440573 +0.184029 0.142884 +-0.0730924 -0.0706121 +-0.0150679 0.162771 +-0.100386 -0.0364229 +0.232309 0.180236 +0.0500317 -0.0151403 +-0.0358331 -0.0131921 +-0.105718 -0.0159144 +0.470688 -0.155167 +-0.10442 -0.236643 +-0.207052 -0.985803 +-0.0570635 0.0149859 +-0.013475 -0.0993776 +-0.020518 0.0445551 +2.09423 2.27571 +-0.613328 0.56222 +-1.2882 -0.18693 +0.0201916 -0.279575 +-0.147453 -0.0367593 +0.106826 -0.0224333 +0.718399 0.231888 +-0.072671 -0.270231 +0.0556126 0.172077 +-0.0196586 -0.0571072 +-1.51787 0.0851381 +-0.264054 -0.00885074 +0.566614 -0.94525 +0.0656901 -0.0585243 +-0.0462951 0.103587 +-0.0777523 -0.429643 +0.0176394 0.00178139 +0.589657 -0.128792 +0.175577 0.0447049 +-0.114847 -0.135173 +-0.207616 0.0739408 +0.20525 -0.0197204 +-0.129179 0.257249 +0.0962749 -0.305882 +-0.132469 -0.0825763 +0.145591 -0.0171257 +0.0285579 0.069344 +-0.0790403 -0.375616 +0.117358 0.0324736 +-0.363571 0.0148123 +0.0197423 0.294551 +0.118848 -0.0569323 +-1.13812 0.828454 +0.374295 -0.46205 +-0.580492 -0.122138 +-0.10833 -0.282855 +1.38325 -0.494947 +0.00560449 0.0418505 +-0.0705219 0.131871 +0.00349508 -0.0627939 +-0.638755 -0.299211 +0.0433963 0.0146943 +0.198552 0.176129 +1.19089 0.270668 +0.183617 0.0703893 +-0.00686963 0.530798 +0.17615 0.242678 +-0.0297995 -0.120233 +0.0718872 -0.0563921 +0.358551 0.125108 +0.0199644 -0.00308663 +0.0696798 0.866459 +-0.0534098 -0.00598162 +-0.547866 -0.634852 +0.0253037 -0.829218 +-0.0507928 0.0778263 +-0.0810119 -0.0516298 +1.05665 0.555839 +0.00195049 -0.196012 +0.462475 0.145569 +0.858693 0.916067 +0.0895053 0.219142 +0.244041 -0.492706 +0.451258 0.0729764 +0.0261209 -0.0706591 +-0.0876567 -0.00418646 +0.144864 0.0457164 +-0.0047042 -0.00107615 +-0.0574089 -0.155551 +-0.606739 0.0306624 +-0.123366 0.091473 +-0.349906 1.43647 +0.0896787 0.562119 +0.159269 0.402324 +-0.23462 0.14525 +-0.142343 -0.0560219 +-0.0703388 -0.00361352 +-0.130518 -0.0653096 +-0.165501 0.00237314 +-0.362576 -0.270228 +0.189618 -0.055082 +0.00382908 -0.0355395 +-0.0547179 0.0404069 +-0.139164 0.129877 +-0.042748 -0.0581872 +0.136626 0.330453 +-0.00368535 0.00631324 +-0.0221253 0.00471318 +0.00608005 -0.120458 +0.0102312 -0.0647905 +-0.00453269 -0.0204162 +0.0387561 -0.0187377 +0.0717596 0.128342 +-0.0773821 0.0100314 +0.052274 0.240563 +0.00138373 0.572173 +0.563797 -0.141138 +-0.00924973 0.0529037 +0.00172157 0.129294 +0.0505951 -0.0987849 +0.100984 0.0205072 +0.0477531 0.207484 +-0.096634 0.0682121 +0.0254934 0.184454 +-0.121293 -0.0409701 +0.627369 -0.798151 +-0.761574 -0.616502 +0.640097 1.47166 +0.193303 0.0974124 +-0.0738319 0.0838408 +0.148146 -0.643894 +-0.10629 -0.142214 +-0.0528397 0.127631 +0.0766603 -1.0647 +-0.0534859 0.213902 +0.894882 -0.192947 +-0.074084 -0.185946 +0.0111582 0.0637103 +0.0707918 0.00791096 +0.270464 -0.491706 +0.0349949 0.0127102 +0.545238 -2.18575 +0.588073 -0.136465 +-0.0540883 0.209139 +0.0234304 -0.0420269 +-0.0285421 -0.065209 +-0.2387 0.689155 +-0.0130033 0.0470918 +-0.196198 -0.371917 +-0.0183488 0.00105995 +1.166 0.389992 +-0.0335589 0.0958197 +0.0478779 0.160942 +0.120819 0.0600061 +0.0540013 -0.090835 +0.0013527 0.0616552 +-0.393684 -0.170675 +0.321333 0.181167 +0.0117634 -0.0394175 +0.060232 -0.160802 +-0.280113 -0.120872 +-0.231224 -0.268741 +0.532301 -0.176349 +-0.0112725 -0.0224346 +0.0279114 -0.0253741 +-0.456857 0.805961 +-0.495597 0.503974 +-0.0600413 -0.114756 +0.515201 -0.00294967 +-0.0026729 0.0470254 +-0.126827 0.0839831 +0.0599251 -0.0803473 +0.0196228 0.00269617 +0.662154 0.55869 +-0.0238438 0.0119404 +-0.102827 0.0431365 +-0.278596 -0.294172 +-0.0494329 -0.0569561 +0.0106903 -0.00406105 +0.142282 0.249706 +-0.333403 -0.210889 +-0.0414599 0.0174067 +0.0511961 -0.146601 +-0.0266887 -0.0117691 +0.00232372 -0.0516313 +-0.03296 0.0578041 +0.0834521 0.272695 +-0.21635 -0.235767 +0.0139224 -0.060894 +0.0843373 -0.0919938 +0.135686 -0.0437522 +0.0296061 0.0603761 +-0.00265528 0.00954145 +-0.255571 0.0802762 +-0.0294522 0.164961 +-0.728582 0.228377 +-0.769445 -0.290066 +0.523228 -0.320963 +-0.160354 -0.37603 +0.00430551 -0.0254643 +0.0224305 0.042718 +0.0482437 0.0429188 +-0.352095 0.344446 +-0.161479 0.243431 +-0.196727 -0.288879 +0.844328 0.58099 +-0.0135461 0.141571 +-0.699685 0.586632 +0.58735 -0.165882 +0.0312933 -0.0939397 +-0.111645 -0.066845 +0.0208612 0.0306696 +-0.0453303 -0.0643391 +-0.136344 -0.188011 +-0.0158955 -0.335811 +-0.0428215 -0.0413346 +0.0443691 0.0794421 +-0.116292 0.0341657 +0.371071 -0.493863 +-0.0892289 -0.113267 +-0.0671363 -0.0608167 +-0.164018 -0.761242 +0.153604 0.102612 +-0.173706 0.160906 +0.34543 0.510915 +-0.451838 0.182975 +0.427734 -0.564745 +0.82739 -0.288533 +-1.13606 -0.211016 +-0.115926 0.443339 +-0.0524808 0.145343 +0.0734038 -0.029919 +-0.23114 0.536383 +0.15251 -0.269885 +0.0919514 -0.312438 +0.311409 -0.146427 +-0.0137871 0.0727938 +-0.235053 -0.129957 +1.91582 0.172853 +0.0328813 -0.0985352 +-0.0252532 -0.216274 +-0.975826 -0.330749 +-0.0221931 0.04711 +-0.151393 -0.296734 +-0.00527735 0.0354576 +-0.00474679 -0.228619 +0.683308 0.632007 +-0.0879547 -0.0191192 +0.130564 -0.0138952 +0.0168282 0.184107 +-0.0725683 0.57223 +-0.0204625 -0.0230237 +0.109044 -0.197229 +0.142939 -0.00308677 +-0.227796 -0.691797 +0.161224 0.0706552 +0.0974294 -0.0622303 +-0.0895248 -0.0551868 +-0.0913175 0.0493085 +0.162813 0.0414351 +0.0460423 -0.115182 +-0.688462 -0.462505 +-0.0687849 0.0556676 +-0.119261 0.426106 +0.249158 -0.485666 +-0.165842 -0.44546 +0.533453 -0.168053 +-0.0527091 0.140897 +0.0212676 -0.140412 +0.395566 0.466813 +0.709856 0.172215 +0.570204 -0.696797 +-0.0065601 0.0835581 +-0.959816 0.16565 +0.325277 0.0657826 +-0.0959163 0.0226752 +0.201654 0.0135768 +0.0705906 -0.262045 +0.0934619 -0.224994 +0.122173 -0.0324817 +-0.131849 -0.143817 +-0.505306 -0.398266 +-0.30547 -0.190423 +0.220993 0.139836 +0.134567 0.051117 +0.0575247 -0.0108836 +0.261663 -0.274889 +0.0122466 -0.0905701 +-0.0960509 -3.40637e-05 +-0.10526 0.0623075 +-0.835636 -0.175008 +0.761119 1.24612 +-0.0126558 -0.522209 +0.0222758 -0.019709 +0.0667368 0.320647 +-1.50494 2.19628 +0.0504509 -0.13309 +0.180975 0.432801 +-0.195578 -0.185986 +-0.0415395 -0.268476 +-0.404031 0.105782 +-0.0638667 0.0264947 +0.103745 0.061507 +0.0807808 -0.58475 +-0.555835 0.637597 +0.00767366 0.0367498 +0.0656758 0.0189496 +-0.0253489 0.140551 +0.00836776 0.254278 +-0.0560918 0.398625 +-0.932929 0.119589 +-0.53647 -0.623841 +-0.0279434 -0.00433493 +0.00832916 0.033048 +-0.0599655 -0.0581355 +0.322205 -0.701014 +-0.0437768 -0.0785661 +0.247637 0.0291075 +0.0534375 -0.162785 +0.010075 -0.482358 +-0.0643972 0.182614 +-0.0990044 0.184326 +0.226992 -0.00613783 +-0.0205405 -0.0586303 +-0.427796 -1.68173 +0.16621 0.277413 +-0.250517 1.34912 +0.0616581 -0.0511528 +-0.327424 0.00830182 +0.0652657 0.044332 +-0.00812957 -0.139149 +0.118454 -0.000238425 +0.104162 0.0463176 +0.691592 0.177669 +0.133852 -0.0690039 +-0.0329437 0.0679601 +0.0115659 0.357898 +0.335065 0.0834189 +-0.29319 0.911813 +0.0218959 0.250528 +0.0130214 0.0523358 +0.076082 -0.0103508 +0.273711 0.755372 +0.0112962 0.0250558 +0.166793 -0.0723047 +0.0984528 -0.0663758 +-0.000552593 0.00704406 +-0.0280376 0.118857 +0.295037 -0.63737 +0.176534 -0.238909 +0.047268 0.0332922 +0.0536505 -0.0178886 +0.113701 -0.192203 +0.0240644 0.166012 +-0.118203 -0.0219341 +0.10377 -0.361207 +-0.0913161 -0.385922 +0.0770931 0.0604889 +-0.0779847 0.0297044 +0.0811338 -0.214539 +-0.17337 -0.0818413 +-0.0166602 -0.0528527 +0.0687284 -0.0713466 +-0.0107787 0.0431855 +0.304625 0.087319 +0.143862 -0.0132954 +0.0594704 0.0396375 +0.178287 -0.0790578 +-0.681844 0.193036 +0.494267 -0.934764 +-0.00807944 -0.069807 +-0.0759931 0.696215 +-0.085265 -0.0833013 +0.0159505 -0.0891714 +0.0209151 -0.376767 +-0.178478 0.136705 +-0.155554 0.115496 +-0.409095 1.38894 +-0.0533592 -0.135802 +-0.112933 -0.236032 +-0.0504699 0.00148803 +0.00393232 -0.082621 +0.487365 0.226823 +-0.573289 0.60787 +0.0299893 -0.0426431 +-0.445703 -0.2738 +0.262288 -0.115435 +-0.0171764 0.0294182 +0.212954 0.227463 +-0.00660083 -0.0316465 +-0.00358638 -0.0176462 +1.06302 -0.194453 +0.186691 -0.0502049 +0.271744 0.306876 +0.0510181 0.188953 +-0.10003 -0.0143424 +0.0149224 0.0525994 +0.0161683 -0.0593177 +-0.0324648 -0.0327154 +0.0225526 -0.0393375 +0.353446 -0.0409421 +-0.210143 -0.0329 +-0.259937 0.056293 +-0.830753 -0.263883 +0.0433815 -0.0135847 +-0.355164 0.0907147 +0.123028 -0.0915637 +-0.0659943 -0.172245 +-0.116129 0.184899 +-0.0897359 0.0308 +0.215966 -0.737754 +0.0296067 -0.0494086 +0.0704748 0.0227521 +0.765828 -1.17515 +0.470481 -0.419354 +0.0884565 -0.0955454 +0.159014 0.108936 +0.0962481 -0.021509 +-0.0481952 0.0705965 +-0.0376962 0.0679362 +0.000589261 0.128126 +-0.036628 0.0515928 +0.00605693 -0.0443783 +-0.081082 -0.00820858 +0.109615 -0.249795 +0.0568287 -0.0953399 +0.0496754 0.0555998 +0.819464 -1.13722 +-0.117131 -0.0934633 +-0.0410023 -0.233446 +0.00206969 0.421413 +0.00926317 0.113169 +-0.681944 0.107604 +-0.0496708 0.0105302 +0.000785046 -0.0226592 +0.281028 0.105811 +-0.29828 -0.0545031 +-0.0974602 0.00537512 +0.0635899 0.142785 +-0.082168 0.00653621 +0.106175 -0.241751 +-0.837896 0.128963 +-0.0700581 0.0155485 +-0.149116 1.48848 +0.129221 0.00475411 +0.570515 0.5165 +0.130734 0.0914017 +-0.664388 -0.228967 +-0.0170435 0.251955 +0.00102484 -0.0566269 +-0.116751 -0.0570632 +-0.568324 -0.289662 +0.00499244 -0.0852224 +-0.234082 0.15158 +0.100479 -0.232628 +0.0967798 -0.0911031 +0.0671634 0.0538609 +0.683864 -0.034786 +0.077044 -0.0458973 +-0.0160355 0.0277959 +-0.0207217 0.0452831 +0.0908037 -0.0552299 +0.414135 -0.0566749 +0.666137 0.202678 +-0.0707784 -0.00499846 +-0.0680229 -0.121825 +-0.0671677 0.118703 +-0.678922 0.612141 +0.37288 -0.0240168 +0.656254 -0.97538 +0.0730456 0.0486041 +0.0666402 0.074511 +0.0524327 0.0120689 +0.00231062 -0.288215 +-0.0457823 0.00278008 +0.360683 -0.749413 +-0.0170978 -0.22944 +0.00587738 -0.469572 +0.0176757 -0.0163935 +-0.12285 0.854599 +-0.021249 0.0311814 +0.540428 0.392253 +-0.149678 -0.0338941 +-0.0379663 -0.0437528 +0.0309257 0.199929 +-0.323012 -0.0698873 +0.214278 0.106453 +-4.50409e-05 -0.0782903 +-1.00548 0.320252 +0.121451 0.201593 +-0.102139 0.439061 +0.336148 -0.0598062 +-0.364509 1.51761 +0.192166 0.0767843 +-0.193175 0.0200957 +-0.0451047 -0.00805768 +0.0389034 0.0585037 +-0.184637 0.0719321 +-0.0155152 -0.347976 +0.0567334 -0.0309136 +0.0801764 0.236277 +0.0485334 0.0797851 +0.97213 0.51126 +-0.0873812 0.112297 +-0.0155525 -0.0335029 +-0.58392 0.124391 +-0.0537771 0.0378705 +-0.0433748 -0.0649095 +-0.0737392 -0.267986 +0.374631 -0.33175 +-0.00747265 0.0485169 +0.303959 -0.186953 +-0.469672 -0.160988 +-0.385702 0.305151 +-0.132072 0.0966956 +-0.0691726 0.0934841 +0.0420527 -0.0644116 +-0.337373 0.537452 +0.288776 0.652834 +0.0465835 0.0141961 +0.18468 -0.0753009 +-0.251945 -0.0951407 +0.168163 -0.0426083 +0.110134 0.0999553 +0.00638357 -0.0197717 +0.185619 0.639966 +0.00946261 -0.0355609 +-0.407027 -0.592457 +0.0332251 -0.029294 +-0.275451 0.215662 +0.210833 0.0735025 +-0.205029 -0.42678 +0.191573 -0.130939 +0.381514 0.401322 +-0.130428 0.0680358 +-0.015074 -0.0728207 +-0.0658851 0.0154606 +0.968827 0.16576 +0.324981 0.274347 +0.0218749 -0.0939053 +0.989996 0.993504 +0.0290972 0.0536246 +-0.0109675 0.231253 +0.162186 -0.0595231 +0.292424 -0.0847464 +0.0276685 -0.056597 +-0.637159 -0.661615 +0.127039 -0.250681 +0.0171685 -0.0940626 +0.0298673 0.0328292 +0.12368 0.154866 +0.149394 -0.046546 +-0.0129622 -0.00394398 +-0.0580624 0.155203 +-0.15344 -0.393806 +-0.0410761 0.0208362 +0.0574006 -0.300166 +0.422934 -0.387759 +-0.372695 0.037265 +0.0625023 -0.113338 +0.164106 0.698417 +0.127462 -0.062826 +0.0532738 -0.0072322 +-0.465438 0.145257 +0.00628358 -0.00160077 +-0.121428 -0.0751773 +-0.152922 -0.0879946 +0.673987 -0.323077 +0.0640223 0.0987082 +0.0474635 -0.141773 +0.0115382 -0.0573223 +0.0380003 0.0615219 +0.0170128 0.0943073 +-0.0535427 -0.0223063 +-0.27647 -0.112168 +-0.184253 0.0539806 +-0.0269032 -0.61584 +1.01645 0.163589 +-0.0951869 -0.133259 +-0.00726965 0.147656 +0.0753312 -0.173833 +0.111143 -0.0835175 +-0.502379 0.384748 +-0.0599729 1.24339 +0.413623 0.0685021 +0.111367 -0.236528 +0.0552064 0.0144965 +-0.00800938 0.221361 +0.353799 0.30108 +-0.0804206 -0.256302 +-0.165884 -0.0130846 +0.0547989 0.00365616 +0.316704 0.103215 +-0.0354738 -0.0505917 +-0.112935 -0.108748 +0.306112 -0.64539 +0.665537 0.292326 +1.12913 0.7776 +0.466418 0.0832409 +0.115775 0.0598834 +0.122634 0.526006 +0.0453521 -0.0159726 +-9.71183e-05 0.0915364 +-0.0951229 -0.0113761 +-0.239746 0.15126 +-0.262137 -0.0508807 +0.0974738 0.158197 +0.0775905 0.413926 +-0.226477 -0.456342 +0.791052 0.387514 +-0.0579071 0.0553515 +0.125548 0.102315 +0.0509835 -0.0698273 +-0.269296 -0.0768447 +0.117655 -0.110246 +-0.279425 0.257149 +-0.268086 -0.352597 +0.0843199 -0.265244 +-0.0521157 -0.0129331 +0.0618409 0.0505351 +-0.0626716 0.0407094 +-1.5645 0.0210375 +0.296088 -0.0089609 +-0.187949 0.0872243 +0.028036 -0.206661 +0.15978 0.0498059 +-0.291062 -0.735197 +0.432512 0.0234001 +0.0356152 0.00202865 +0.0197691 -0.221484 +0.166471 0.321786 +0.0422862 0.0440987 +0.651658 -2.08752 +0.066443 0.0120513 +0.369333 0.312741 +0.610116 0.149037 +0.00431914 -0.136602 +0.0634667 -0.168412 +-0.0182412 -0.092265 +-0.0326137 0.0750936 +0.172541 -0.594562 +0.751086 0.409676 +0.0399142 -0.0273256 +-0.180915 0.317277 +-0.257596 0.020327 +0.271109 0.762617 +-0.132362 -0.0285368 +1.45098 0.129919 +0.291625 0.156547 +0.0485678 0.104147 +0.266414 -0.199232 +-0.187199 0.355542 +-0.0313765 -0.131535 +-0.141486 -0.352057 +0.0281989 -0.397025 +0.038311 -0.0351147 +-0.173675 0.890355 +-0.0422534 -0.521228 +0.16337 -0.086475 +1.45563 -1.01756 +-0.138971 0.0401858 +-0.0892371 -0.951543 +-0.30613 0.562408 +0.0155051 -0.000118334 +-0.225091 0.0947022 +0.0447158 -0.0486182 +-0.0738408 -0.164329 +-0.220933 -0.100555 +-0.0710891 -0.211202 +0.134223 0.121394 +0.624657 0.285451 +0.118256 -1.52791 +0.315681 -0.0286586 +-1.04563 -0.00188948 +-0.507682 0.607601 +-0.0134115 0.0588577 +0.00853491 -1.18247 +0.00372387 0.0342169 +-0.0668158 -0.0193555 +0.0880809 0.0426238 +0.119057 -0.139578 +-0.613717 0.258388 +-0.0398399 -0.0464705 +0.27501 0.0998511 +0.22104 -0.120763 +0.122445 0.0999413 +-0.0493003 0.107419 +-0.057945 0.0762557 +0.0307174 -0.313532 +-0.058224 -0.0936808 +0.121038 0.0479083 +-0.1173 0.0215108 +-0.0326079 -0.155224 +-0.0517472 0.344739 +-0.194898 0.0265733 +0.110316 -0.105781 +-0.0900286 -0.0365474 +-0.295851 -0.118982 +-0.00412957 0.0492583 +-0.00609722 -0.0105373 +0.0764576 -0.404426 +-1.26089 0.636935 +-0.0086512 -0.142662 +-0.170129 0.0988276 +-0.21504 0.0359004 +0.0874767 -0.166577 +-0.10737 0.563674 +0.105932 0.351834 +0.0378673 -0.1181 +-0.0259636 -0.126066 +-0.0241681 -0.197605 +-0.0610792 -0.680279 +0.678982 -0.770279 +0.320496 -0.0173057 +-0.0144309 0.0383413 +-0.100871 -0.586556 +-0.454242 -0.105021 +-0.072346 0.339106 +-0.0175293 -0.0261339 +-0.0653775 -0.293445 +-0.371351 0.171722 +0.156649 -0.0624709 +1.03822 0.164814 +-0.277467 -0.154869 +0.00838571 0.022505 +0.0709036 0.225921 +0.0326422 -0.067415 +0.110329 0.0425534 +-0.710064 -0.0265479 +0.0488773 0.104662 +-0.219907 0.022739 +0.271063 0.0368079 +0.128381 -0.0545813 +-0.105239 0.0453901 +-0.0147619 0.00893273 +0.344266 0.0738835 +-0.00346507 -0.476595 +0.0407037 0.0196631 +-0.745351 -0.323468 +0.410939 0.322028 +-0.07393 -0.755915 +-0.114634 0.0126194 +-0.0249116 0.729894 +-0.877551 -2.10649 +0.00227465 -0.186088 +-0.23793 0.00167412 +0.26124 -1.04802 +-0.054396 -0.0218225 +-0.187285 0.0929362 +-0.521331 0.0894923 +-0.100958 0.0342958 +0.246818 0.0873904 +0.85272 -0.0145155 +-0.0212865 0.00405606 +-0.221875 0.0512329 +0.127422 0.107075 +-0.203619 -0.343193 +0.296365 0.0367821 +-0.274344 -0.958303 +0.029677 0.0877893 +0.478869 0.184553 +-0.0418666 -0.137733 +-0.161592 0.0259437 +0.103814 -0.0984213 +-0.1433 0.52507 +-0.217348 -0.150768 +-0.0936847 0.0130458 +0.0873813 -0.0716036 +-0.0487055 -0.011375 +-0.017258 -0.028858 +0.088816 -0.440618 +0.0167372 -0.124864 +-0.0574965 0.0797714 +0.0357964 -1.93653 +-0.928001 -1.23861 +0.00473227 0.0859828 +-0.341355 -0.0469796 +-0.40552 -0.0675452 +-0.0126697 -0.0154727 +-0.228494 -0.135456 +-0.0975965 0.0283552 +0.280483 0.286364 +0.156361 -0.0473007 +-0.00666624 0.192508 +0.0877984 -0.114017 +0.161448 0.729274 +-0.0316737 0.0361816 +-0.0204193 -0.0366736 +-0.160007 -0.0888409 +-0.00252717 -0.0201257 +-0.0424654 -0.00237869 +0.111596 -0.18748 +0.852928 -0.202864 +-0.0546009 0.0292675 +0.512399 -0.133829 +1.10072 -0.690984 +0.0476502 0.194094 +-0.504835 0.962827 +0.116623 0.590257 +0.0747833 -0.19604 +-0.217172 -0.113508 +0.209036 -0.0245339 +-0.00770109 -0.0875698 +-0.0287003 0.095797 +-0.0580586 0.0456268 +0.011423 -0.0167606 +0.0930693 0.347708 +-0.0917598 0.111998 +-0.285701 -0.180588 +-0.0161064 0.056212 +0.0153418 0.0163237 +-0.156599 0.101888 +0.152841 -0.563855 +0.123568 0.0882502 +0.330738 0.281158 +-0.1309 -0.10639 +0.0308945 -0.0858848 +0.92027 -0.678817 +-0.0135577 -0.375523 +-0.0560503 0.0717304 +0.144473 0.144603 +0.105927 0.00560296 +-0.0990243 -0.238251 +0.000763311 -0.0335355 +0.0243974 0.128548 +0.185033 0.0296875 +-0.206115 -0.118474 +-0.0290233 0.0672219 +-0.636212 -0.59991 +-0.112243 -0.00769563 +-0.809529 -1.11517 +0.00688708 -0.0143895 +0.245648 0.0195232 +-0.202328 -0.0186437 +0.422257 0.0420389 +0.0807584 0.0462774 +0.00714528 0.00257903 +-0.0809965 0.0824548 +0.126756 1.34722 +-0.010983 0.00364586 +0.895223 0.135693 +0.168513 -0.202606 +-0.0263335 0.0243556 +-0.0715481 0.0157384 +-0.0438252 -0.00168418 +0.117108 0.176384 +-0.217647 0.26361 +0.175453 -0.0162573 +0.208618 -0.0610217 +-0.0781941 0.122556 +0.0356142 -0.0848654 +-0.289663 0.182259 +0.401908 0.138674 +0.00090482 -0.00718502 +-0.0381108 0.0511837 +0.102095 -0.0395193 +-0.244439 1.38615 +0.117537 -0.0247126 +-0.0364695 0.0332572 +-0.181823 0.406242 +0.163461 -0.408171 +0.0501896 -0.0913667 +0.109223 0.0790115 +-0.0177847 -0.0515601 +0.573389 -0.303129 +-0.136198 0.0735794 +0.40729 0.166834 +0.0192287 0.0495981 +-0.384896 1.1093 +0.0870902 -0.156128 +0.293804 0.0646078 +-0.291576 0.376771 +0.360155 -0.218389 +-0.0814341 -0.06641 +-0.767586 0.559541 +0.260802 -0.118598 +-0.661169 -0.380073 +0.00242567 -0.143807 +0.0394065 -0.0750909 +-0.0696649 -0.143945 +0.320051 0.13331 +-0.050974 0.0864062 +0.0198923 -0.175185 +0.171257 0.201264 +0.038315 0.212575 +0.0416008 0.101508 +-0.323638 -0.0845716 +2.88019 -1.05205 +0.109098 0.22625 +0.0988632 0.0265472 +0.0657971 0.0952566 +-0.0975233 -0.0464543 +0.208886 -0.272403 +-0.845561 -0.120449 +-0.0502459 -0.0297575 +-0.0827998 0.107993 +-0.073852 -0.114337 +0.0553403 -0.0211322 +0.280545 -0.268729 +-0.408087 1.8203 +-0.0883857 0.172954 +0.048448 0.0473823 +0.43692 0.002743 +0.150404 -0.266053 +-0.0562674 -0.0571864 +0.0260653 -0.100217 +0.0378167 -0.165087 +0.106327 0.137594 +-0.0200417 0.103288 +0.0168641 0.0375953 +-0.317311 -0.198221 +0.177531 0.129027 +-0.331855 0.815667 +0.101514 -0.0371502 +-0.0651025 0.04573 +-0.0610014 0.0466641 +0.0662373 -0.385238 +0.147612 -0.00256839 +-0.0462112 -9.37696e-05 +-0.00743022 -0.165768 +0.608776 -0.00969311 +0.176005 0.0981239 +-0.20278 -0.126501 +-0.0188202 -0.228211 +0.197922 0.373269 +0.0752669 -0.273872 +-0.00662212 -0.143461 +0.0203142 -0.298977 +0.2038 0.14396 +0.0431218 -0.288552 +0.0761436 0.0436188 +0.0752552 -0.0610314 +-0.0874592 -0.132025 +0.0200588 -1.0318 +0.149974 0.48179 +-1.18248 0.191382 +0.0249451 -0.301662 +-0.0253246 0.152032 +0.119229 -0.0742102 +-0.00153354 -0.862063 +-0.00356576 -0.0727438 +0.329844 0.0460678 +-0.0792562 0.157517 +-0.187151 -0.29569 +-0.0928915 0.068226 +0.0052729 0.393732 +0.415766 -0.0473633 +0.113767 0.0276013 +0.211894 -0.543177 +2.12311 0.872142 +-0.0115144 -0.113242 +0.00305528 -0.236676 +0.0284766 0.130247 +0.0151803 0.0772837 +0.379385 0.295381 +-0.325754 0.19834 +0.323014 0.0227541 +-0.148391 0.141745 +0.0920333 0.0636779 +-0.116061 0.209898 +-0.500338 -0.926894 +0.793109 0.453292 +0.0217652 -0.219029 +-0.113618 0.00709628 +-0.395147 0.0817008 +-0.0316934 0.0126123 +-0.0208616 -0.0638467 +-0.043954 0.077383 +-0.671858 0.693308 +-0.239776 0.193601 +-0.102209 0.0405923 +-0.298183 -0.332669 +0.142488 -0.323972 +0.117512 0.0941854 +0.099414 0.0189845 +0.127458 -0.180456 +-0.0935883 -0.0399261 +-0.68499 0.451567 +-0.239869 -0.128758 +0.158212 0.159309 +0.531026 0.0899653 +-0.31314 0.377681 +-0.129502 -0.0479917 +-0.130955 0.0468239 +-0.0786693 0.620697 +0.0377622 0.0497464 +-0.153976 -0.0831282 +-0.0338834 0.101655 +-0.206711 0.116114 +0.00964304 -0.0606079 +0.103997 0.0267536 +0.197343 0.097828 +0.230162 -0.594503 +0.14658 -0.29847 +-0.0386065 0.0373508 +0.0571125 -0.309117 +0.101727 0.108984 +0.00537024 -0.0165944 +-0.138921 0.195169 +-1.08256 -0.247066 +0.0562543 -0.0970629 +0.0128449 0.0807276 +-0.0702656 0.0432571 +0.0483864 4.51546e-05 +0.0561259 -0.0985869 +-1.65646 -0.490094 +0.0443388 0.0804129 +-0.549508 0.0607587 +0.164516 -0.013177 +-0.235623 -0.207325 +-0.0606149 1.43604 +0.10211 -0.222698 +-0.15752 -0.0202124 +-0.144955 0.063271 +-0.111735 -0.484929 +0.327209 0.731738 +0.226784 -0.185254 +-0.236143 -0.174404 +0.0927027 -0.144036 +-0.299769 -0.05796 +-0.107458 0.0212974 +-0.013448 -0.0264092 +0.0889346 -0.607043 +-0.00208161 -0.0171967 +0.615707 0.274309 +-0.136222 0.309614 +0.163408 -0.148205 +-0.0243592 0.348353 +0.0195702 -0.0342714 +0.395617 0.198248 +0.312831 0.21709 +0.0722101 -0.0750901 +0.259631 0.00352842 +0.0310258 -0.0618774 +0.0500598 0.0643601 +0.101743 -0.132415 +0.0676941 0.396451 +-0.408747 0.249722 +0.147362 0.23843 +0.815954 0.266786 +0.01963 0.0789677 +0.399842 0.190419 +0.0572629 -0.0109528 +0.15346 0.0207748 +0.292607 -0.264452 +0.0308911 -0.00999681 +0.455339 0.108024 +-0.0773739 0.241833 +-0.0613043 0.0365772 +0.0209921 0.0302349 +-0.0753773 0.0985481 +-0.10301 -0.139168 +-0.488197 0.23594 +-0.0724871 0.0839488 +0.189116 0.0254097 +0.0302434 0.0244613 +1.01865 0.344124 +-0.2796 -2.09866 +-0.391167 -1.49991 +-0.0400212 -0.191204 +-0.00335432 -0.0385048 +-0.104197 0.0241415 +0.530754 -0.119158 +0.0825823 0.0324067 +0.020265 -0.044455 +0.00561441 0.0475493 +-0.117221 0.0459611 +-0.0933396 -0.193964 +0.0940098 0.00788474 +0.00434339 0.0594764 +0.357724 -0.0856205 +0.0419475 0.0836048 +-0.0411524 0.150115 +0.471069 0.115231 +0.373921 0.638581 +-0.12933 -0.134346 +-0.0555733 0.122349 +0.718243 0.254868 +0.0744885 -0.108977 +-0.199681 0.244984 +-0.120881 -0.147624 +0.102405 0.151748 +0.0816071 -0.224924 +0.020753 0.0615947 +0.479649 0.800554 +-0.249894 -0.0199397 +0.0928211 -0.0465032 +-0.102112 -0.0317925 +0.186735 0.18045 +0.0187288 -0.0219885 +0.509179 -0.0615067 +-0.0662508 0.150161 +-0.151667 0.0643036 +-0.120717 -0.0780841 +0.237095 -0.255971 +-1.06656 0.264979 +0.0303471 0.124599 +0.0109669 -0.0180219 +-0.0898895 -0.313279 +-0.0491656 0.269694 +-0.0726921 -0.349796 +-0.35646 -0.156218 +-1.05128 0.770387 +0.0314512 -0.0119215 +-1.13735 -0.0863415 +-0.0999291 -0.425132 +0.0539869 -0.0160709 +-0.202952 0.14187 +0.344152 0.303612 +0.377872 -0.229863 +0.115247 0.071254 +-0.592737 -0.144239 +-0.102368 -0.12318 +-0.0366735 0.0722614 +-0.0419756 -0.136731 +-0.143942 -0.0667887 +-0.399013 1.03127 +0.346855 -0.439567 +-0.592661 0.698808 +-0.0450737 0.0463675 +0.00212281 -0.0688102 +0.0373418 0.0393142 +-0.0869285 -0.0989411 +0.42341 -0.656622 +-0.0795503 0.0880962 +-0.0325754 0.159498 +-0.126554 -0.0424011 +-0.0218797 -0.173142 +-0.419703 0.007246 +0.0452932 -0.000662555 +-0.140146 -0.0675916 +0.333262 0.310097 +0.838934 0.0866385 +0.836893 -0.0318262 +0.325967 -0.647226 +-0.080696 0.83685 +-0.042753 -0.0761946 +0.0197025 0.0173802 +-0.764578 0.465018 +-0.700157 0.0094571 +0.76798 -1.23668 +-0.0197455 -0.0995297 +0.0486367 -0.115962 +-0.0661133 -0.164129 +-0.0885735 -0.0130789 +-0.069146 -0.055291 +0.0516421 -0.0412822 +-0.0780977 -0.109961 +-0.30576 -0.202241 +0.189997 -0.276875 +0.00549865 -0.165913 +0.0210425 0.0878898 +-0.113882 0.118069 +0.753616 -0.414715 +0.0772304 -0.0380918 +-0.114746 0.0793408 +-0.115485 0.030817 +0.225115 -0.112797 +-0.411242 0.930709 +-0.00299728 0.16303 +0.485698 0.0294494 +0.130466 0.0661792 +-0.592527 -0.979858 +0.732208 -1.2492 +-0.0285607 -0.066303 +-0.48791 0.430951 +0.114427 0.487956 +0.340144 -0.53086 +-0.31892 -0.0340713 +-0.370815 0.201413 +0.145934 -0.249257 +0.164066 0.0197044 +0.0658649 0.283868 +1.17805 -0.656911 +0.0145956 -0.0143498 +0.20414 -0.0699888 +-0.339187 0.157776 +0.0824717 0.206896 +-0.00722908 -0.0901314 +-0.0826021 0.0298101 +0.314218 -0.218479 +-1.30337 -0.518702 +-1.06027 -1.20189 +0.0960665 -0.0513316 +0.204173 -1.20528 +0.185045 -0.0080442 +0.145046 0.0169678 +-0.0800295 0.274552 +0.120551 -0.0857291 +-0.380765 0.742415 +0.0214152 -0.0211094 +-0.553169 0.536279 +-0.0109204 -0.0203397 +0.101476 -0.338801 +0.218053 -0.0898853 +0.625221 0.191356 +-0.132394 -0.166204 +0.00366559 -0.0640251 +-0.394396 -0.128326 +0.835618 -0.247982 +0.133353 0.786466 +0.0116758 0.0377436 +-0.0723792 0.115737 +-0.42297 0.731825 +0.10471 -0.032244 +0.130441 0.0406793 +0.0217232 -0.0185129 +0.145342 0.127218 +-0.00963872 -0.0644117 +-0.0337681 0.119853 +-0.33131 -0.105838 +-0.163087 -0.0331184 +0.121208 0.00452575 +0.894011 0.792514 +0.0079612 -0.0296245 +0.0371514 0.100531 +-0.21951 0.174648 +-0.0827941 -0.207946 +-0.880235 -1.03787 +0.108489 0.113328 +0.135769 1.89678 +-1.53548 -0.055834 +-1.68323 -1.10831 +-0.110878 0.155672 +-1.05394 -0.365825 +-0.143388 -0.518465 +-0.316553 -0.986968 +0.223436 -0.122033 +-0.648557 0.563667 +0.119427 -0.0381858 +-0.00908522 0.00276517 +0.0501623 0.00390936 +-0.469222 -0.353964 +-0.0567574 0.143589 +-0.339613 0.0173659 +0.10742 0.111965 +0.0121057 -0.0577297 +0.0895489 -0.0448598 +0.0220036 -0.0469002 +0.223139 0.13805 +0.018963 -0.237873 +0.430094 -0.0760504 +-0.398175 -0.254413 +1.1399 0.322433 +-0.104756 -0.680462 +-0.0968042 -0.151337 +-1.00612 -0.57666 +-0.0306041 0.06255 +0.329883 0.0369467 +0.0130917 -0.248462 +0.0168272 -0.00662081 +1.57178 0.0805332 +0.0481957 -0.444423 +0.0720704 -0.0661135 +0.0772655 0.0178984 +0.0321957 -0.0316463 +0.317663 0.116475 +0.361186 -0.432914 +-0.0455193 0.0203353 +-0.432703 -0.407618 +0.286986 0.824519 +0.0576506 -0.000525572 +0.0192941 -0.168401 +-0.0865819 0.281957 +0.199385 0.454996 +-0.0385882 0.000548888 +0.117199 -0.0570663 +0.0038996 -0.180196 +-0.0597959 0.0890031 +0.231515 -0.183032 +0.139537 0.172207 +0.0716053 -0.0911146 +-0.176103 0.949622 +-0.112662 0.0527873 +-0.0796088 -0.0656395 +0.89698 0.113646 +0.0699995 0.0895691 +0.11956 0.257604 +-0.0235414 -0.0733944 +0.764525 0.331758 +0.0130018 -0.655735 +-0.0144565 0.0436494 +0.802164 -0.799909 +-0.768826 0.379543 +0.016184 -0.0887078 +0.138515 0.200205 +0.0107463 -0.18512 +-0.020833 -0.0046372 +0.157239 -0.212637 +0.0266753 0.0784038 +-0.0925733 -0.032346 +-0.591733 -0.139492 +0.0018938 0.00167224 +-0.785994 -0.0983609 +0.207587 0.194859 +-0.207297 1.04311 +0.0701435 -0.198537 +0.137753 0.215647 +0.305609 0.0220634 +0.556543 0.300255 +0.0113946 0.244646 +0.0446697 0.0297715 +0.108257 0.0214829 +-0.0719919 0.189203 +-0.528751 -0.187523 +-0.0616705 0.0579953 +0.0167119 0.0433849 +0.136743 0.082963 +-0.106239 -0.0517642 +0.0232797 -0.0255146 +-0.0441564 -0.137474 +1.4605 -0.698465 +0.250271 0.533839 +-0.139094 -0.0795562 +0.251619 0.0365344 +-0.560689 -0.0898449 +0.757837 -0.0514482 +0.17476 0.0648157 +0.0636554 0.0680161 +-0.180422 0.00269268 +0.0397375 -0.00803797 +-0.00772659 0.00884617 +-0.18368 0.0921419 +0.223071 0.105578 +-0.151871 0.0615231 +-0.582941 -0.224771 +0.049914 0.220096 +0.0305831 0.0585125 diff --git a/code/common/model_builder.py b/code/common/model_builder.py index 9873024..5797edd 100644 --- a/code/common/model_builder.py +++ b/code/common/model_builder.py @@ -4,6 +4,7 @@ from extras.graph_representations import Representation from decoders.nonlinear_transform import NonlinearTransform +from decoders.complex import Complex from encoders.bipartite_gcn import BipartiteGcn from encoders.message_gcns.gcn_diag import DiagGcn @@ -283,6 +284,8 @@ def apply_basis_gcn(encoder_settings, encoding, internal_shape, layers): def build_decoder(encoder, decoder_settings): if decoder_settings['Name'] == "bilinear-diag": return BilinearDiag(encoder, decoder_settings) + elif decoder_settings['Name'] == "complex": + return Complex(int(decoder_settings['CodeDimension']), decoder_settings, next_component=encoder) elif decoder_settings['Name'] == "nonlinear-transform": return NonlinearTransform(encoder, decoder_settings) else: diff --git a/code/decoders/complex.py b/code/decoders/complex.py new file mode 100644 index 0000000..780a5d4 --- /dev/null +++ b/code/decoders/complex.py @@ -0,0 +1,105 @@ +import tensorflow as tf +from model import Model + + +class Complex(Model): + X = None + Y = None + + encoder_cache = {'train': None, 'test': None} + + def __init__(self, dimension, settings, next_component=None): + Model.__init__(self, next_component, settings) + self.dimension = dimension + + def parse_settings(self): + self.regularization_parameter = float(self.settings['RegularizationParameter']) + + def compute_codes(self, mode='train'): + if self.encoder_cache[mode] is not None: + return self.encoder_cache[mode] + + print("HEAVY COMPUTATIONS HERE - SHOULD BE CALLED TWICE. NOW: "+mode) + subject_codes, relation_codes, object_codes = self.next_component.get_all_codes(mode=mode) + e1s = tf.nn.embedding_lookup(subject_codes, self.X[:, 0]) + rs = tf.nn.embedding_lookup(relation_codes, self.X[:, 1]) + e2s = tf.nn.embedding_lookup(object_codes, self.X[:, 2]) + + self.encoder_cache[mode] = (e1s, rs, e2s) + return self.encoder_cache[mode] + + + def get_loss(self, mode='train'): + e1s, rs, e2s = self.compute_codes(mode=mode) + + energies = tf.reduce_sum(e1s * rs * e2s, 1) + return tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(energies, self.Y)) + + def local_initialize_train(self): + self.Y = tf.placeholder(tf.float32, shape=[None]) + self.X = tf.placeholder(tf.int32, shape=[None, 3]) + + def local_get_train_input_variables(self): + return [self.X, self.Y] + + def local_get_test_input_variables(self): + return [self.X] + + def predict(self): + e1s, rs, e2s = self.compute_codes(mode='test') + + e1s_r, e1s_i = self.extract_real_and_imaginary(e1s) + e2s_r, e2s_i = self.extract_real_and_imaginary(e2s) + rs_r, rs_i = self.extract_real_and_imaginary(rs) + + energies = tf.reduce_sum(e1s_r * rs_r * e2s_r) \ + + tf.reduce_sum(e1s_i * rs_r * e2s_i) \ + + tf.reduce_sum(e1s_r * rs_i * e2s_i) \ + - tf.reduce_sum(e1s_i * rs_i * e2s_r) + + return tf.nn.sigmoid(energies) + + def extract_real_and_imaginary(self, composite_vector): + embedding_dim = int(self.dimension/2) + r = tf.slice(composite_vector, [0, 0], [-1, embedding_dim]) + i = tf.slice(composite_vector, [0, embedding_dim], [-1, embedding_dim]) + return r, i + + def predict_all_subject_scores(self): + e1s, rs, e2s = self.compute_codes(mode='test') + all_subject_codes = self.next_component.get_all_subject_codes(mode='test') + + e1s_r, e1s_i = self.extract_real_and_imaginary(all_subject_codes) + e2s_r, e2s_i = self.extract_real_and_imaginary(e2s) + rs_r, rs_i = self.extract_real_and_imaginary(rs) + + all_energies = tf.matmul(e1s_r, tf.transpose(rs_r * e2s_r)) \ + + tf.matmul(e1s_i, tf.transpose(rs_r * e2s_i)) \ + + tf.matmul(e1s_r, tf.transpose(rs_i * e2s_i)) \ + - tf.matmul(e1s_i, tf.transpose(rs_i * e2s_r)) + + all_energies = tf.transpose(all_energies) + return tf.nn.sigmoid(all_energies) + + def predict_all_object_scores(self): + e1s, rs, e2s = self.compute_codes(mode='test') + all_object_codes = self.next_component.get_all_object_codes(mode='test') + + e1s_r, e1s_i = self.extract_real_and_imaginary(e1s) + e2s_r, e2s_i = self.extract_real_and_imaginary(all_object_codes) + rs_r, rs_i = self.extract_real_and_imaginary(rs) + + all_energies = tf.matmul(e1s_r * rs_r, tf.transpose(e2s_r)) \ + + tf.matmul(e1s_i * rs_r, tf.transpose(e2s_i)) \ + + tf.matmul(e1s_r * rs_i, tf.transpose(e2s_i)) \ + - tf.matmul(e1s_i * rs_i, tf.transpose(e2s_r)) + + return tf.nn.sigmoid(all_energies) + + def local_get_regularization(self): + e1s, rs, e2s = self.compute_codes(mode='train') + regularization = tf.reduce_mean(tf.square(e1s)) + regularization += tf.reduce_mean(tf.square(rs)) + regularization += tf.reduce_mean(tf.square(e2s)) + + return self.regularization_parameter * regularization diff --git a/code/encoders/message_gcns/gcn_basis.py b/code/encoders/message_gcns/gcn_basis.py index a8b36b6..e482eda 100644 --- a/code/encoders/message_gcns/gcn_basis.py +++ b/code/encoders/message_gcns/gcn_basis.py @@ -85,7 +85,15 @@ def combine_messages(self, forward_messages, backward_messages, self_loop_messag collected_messages_f = tf.sparse_tensor_dense_matmul(mtr_f, forward_messages) collected_messages_b = tf.sparse_tensor_dense_matmul(mtr_b, backward_messages) - new_embedding = self_loop_messages + collected_messages_f + collected_messages_b + self.b + if mode=='train': + choice = tf.select(tf.random_uniform([50,1]) > 0.5, tf.ones([50,1], dtype=tf.int32), tf.zeros([50,1], dtype=tf.int32)) + options = tf.constant([[2., 0.], [0., 2.]]) + mixer = tf.nn.embedding_lookup(options, choice) + mixer = tf.reshape(mixer, [2,50]) + else: + mixer = [1.,1.] + + new_embedding = mixer[1] * self_loop_messages + mixer[0] *(collected_messages_f + collected_messages_b) #+ self.b if self.use_nonlinearity: new_embedding = tf.nn.relu(new_embedding) diff --git a/code/tools/cluster.py b/code/tools/cluster.py index a686bcc..d816c58 100644 --- a/code/tools/cluster.py +++ b/code/tools/cluster.py @@ -59,7 +59,11 @@ plt.get_cmap('plasma') -t = [np.log(d[name]) for name in names] +t = [d[name] for name in names] + +print(names[np.argmax(t)]) +print(np.max(t)) +print(X[np.argmax(t)]) ax.scatter(X[:,0], X[:,1], t, marker='o', alpha=1, s=5) diff --git a/code/tools/ensemble.py b/code/tools/ensemble.py index 7898623..395236b 100644 --- a/code/tools/ensemble.py +++ b/code/tools/ensemble.py @@ -70,14 +70,26 @@ def combine_prediction(self, left, right): others[i] = self.weight * left[1][i] + (1 - self.weight) * right[1][i] rank = np.sum(np.array(others) >= target) + 1 - return 1 / rank + return rank def combined_mrr(self): - return np.mean(list(self.combine())) + return np.mean(1 / self.ranks) + + def compute_ranks(self): + self.ranks = np.array(list(self.combine())) + + def hits_at(self, threshold): + hits = self.ranks[self.ranks <= threshold] + return len(hits) / len(self.ranks) if args.method == 'cutoff': model = CutoffEnsemble(1000, args.p1, args.p2) elif args.method == 'weighted_sum': model = WeightEnsemble(0.5, args.p1, args.p2) +model.compute_ranks() + print(model.combined_mrr()) +print(model.hits_at(1)) +print(model.hits_at(3)) +print(model.hits_at(10)) \ No newline at end of file diff --git a/code/train.py b/code/train.py index 844d1d1..c4c70d1 100644 --- a/code/train.py +++ b/code/train.py @@ -168,5 +168,5 @@ def t_func(x): #horrible hack!!! optimizer.set_session(model.session) optimizer.fit(train_triplets, validation_data=valid_triplets) -scorer.dump_all_scores(valid_triplets, 'dumps/subjects.valid', 'dumps/objects.valid') -scorer.dump_all_scores(test_triplets, 'dumps/subjects.test', 'dumps/objects.test') \ No newline at end of file +#scorer.dump_all_scores(valid_triplets, 'dumps/subjects.valid', 'dumps/objects.valid') +#scorer.dump_all_scores(test_triplets, 'dumps/subjects.test', 'dumps/objects.test') diff --git a/forward.rels b/forward.rels new file mode 100644 index 0000000..62a9023 --- /dev/null +++ b/forward.rels @@ -0,0 +1,1345 @@ +-0.413586 0.0800668 +-0.0316442 0.226167 +-0.222732 0.0426428 +-0.141877 0.122111 +-0.202141 0.139092 +-0.00415614 0.0226156 +-0.065363 -1.55347 +-0.00787841 0.0166331 +-0.117538 0.318537 +-0.0890889 0.0978107 +0.19147 0.195187 +-0.168502 -0.165202 +0.313615 -0.0487305 +-1.883 0.171329 +-0.0789889 -0.0788495 +0.134501 -0.103892 +0.332793 0.309794 +-0.541348 -0.0407343 +0.0813564 0.0742656 +0.526248 -0.26214 +-0.0331844 -0.283219 +-0.183832 0.330375 +-0.00666887 0.0581338 +0.0316253 0.0708937 +-0.0839955 -0.0380279 +0.0103662 0.0245113 +-0.0104113 0.0245111 +-0.600621 -0.0708464 +0.108013 0.172954 +-0.0367853 -0.0675886 +-0.0538608 -0.0119004 +0.785291 -1.4965 +0.302579 0.104764 +0.349617 0.306414 +-0.0054153 -0.0959548 +-0.0392803 -0.0140456 +-0.056528 0.0208083 +-0.270596 0.0433962 +0.177521 -0.508459 +0.480206 -0.654715 +0.232351 -0.42398 +0.0761485 0.0198413 +0.0157394 0.0218325 +-0.102766 0.517658 +-0.152305 -0.0596636 +0.0664495 -0.189101 +-0.131786 0.176149 +0.73043 0.701415 +-0.0616869 -0.0498679 +0.188707 0.347789 +0.143158 -0.184325 +0.22974 0.19892 +-0.0143316 -0.541064 +-0.0364509 -0.016976 +-0.0837653 -0.0754527 +0.607649 -0.898972 +-0.0628026 0.0368853 +-0.182303 0.00271567 +0.0536413 0.0759407 +0.00964974 -0.0102666 +-0.0325954 0.00827392 +0.133059 -0.0812101 +0.199622 0.149539 +-0.136322 -0.0532465 +0.132318 -0.0741917 +0.0135737 0.118919 +0.903013 -0.0381182 +0.450169 -0.210366 +0.0348223 0.0282889 +0.71465 1.1487 +-0.0369062 0.325612 +0.239825 -0.37179 +-0.223684 -0.0851169 +0.921087 -0.152869 +-0.166051 -0.0845485 +0.0417827 0.0366996 +-0.464869 0.0152065 +0.0130291 -0.132145 +-0.0191764 -0.0671087 +-0.042932 -0.0168901 +-0.0183566 0.356805 +-0.0250365 0.0337901 +-0.252482 -0.3818 +-0.0778392 -0.248067 +0.700642 0.182631 +-0.237931 1.0966 +0.049272 0.101144 +-0.0532355 0.0359457 +0.0559465 0.185768 +-0.240039 -0.368055 +-0.823402 -0.0156773 +0.28722 -0.121673 +0.203887 -0.161023 +-0.0155132 -0.0489815 +0.382482 -0.22006 +-0.0207331 0.0145304 +0.0204718 -0.0355274 +-0.279315 -0.648562 +-0.208838 -0.14854 +0.143944 -0.680352 +0.0983941 0.0889881 +0.124687 -0.228846 +0.0651277 -0.18156 +0.0676249 -0.097264 +-0.048429 0.0258124 +0.159615 0.602734 +0.00370907 -0.00786307 +0.0311993 -0.00596488 +-0.0281182 0.00165735 +-0.664768 -0.553108 +-0.319921 -0.090998 +-0.00684389 0.00433445 +-0.0815089 0.0326949 +0.0140499 0.0452984 +0.0864674 0.0820629 +0.0770996 -0.133732 +0.372948 0.778368 +0.0852151 0.127162 +0.0369916 -0.0198714 +0.0179742 0.0213808 +-0.0197604 0.0154064 +0.253576 -0.0685211 +-0.0150873 0.0175844 +-0.0498264 0.0366983 +-0.123492 0.0725678 +-0.244961 -0.025546 +0.277116 0.177856 +-0.0984874 -0.0310884 +-0.0387361 -0.0112264 +-0.0932259 -0.0646336 +-0.150419 0.0154313 +-0.123493 -0.461535 +-0.0126281 0.0441104 +0.403754 0.183835 +-0.0674842 0.018899 +-0.155972 0.0305346 +0.033438 0.158827 +0.0614737 0.0243958 +0.0907725 0.162981 +-0.161832 0.123719 +0.0616066 0.222758 +0.138398 0.0965659 +-0.120433 -0.0192263 +-0.19312 -0.461786 +-0.582233 -0.0312731 +0.0341501 -0.0659868 +0.0360173 -0.1724 +-0.208344 0.842109 +0.16581 0.0581979 +0.186657 0.0977125 +0.654257 0.327477 +0.434578 -1.13726 +0.132887 -0.0753921 +-0.0527011 -0.117282 +0.0642695 -0.00535557 +0.00066429 -0.0126541 +0.415125 0.300712 +0.265007 0.171191 +-0.154392 -0.911735 +0.00978994 -0.0432308 +-0.0304771 0.442901 +0.0050352 0.294333 +0.0226118 0.0355136 +-0.069822 -0.0652482 +0.934899 -0.580233 +0.229204 0.165446 +0.313028 -0.0162408 +-0.787709 0.00476098 +0.0591807 0.0253649 +-0.720301 0.47554 +0.0516424 0.0165249 +-0.158671 0.00165152 +0.0432108 -0.0197952 +0.106654 -0.164172 +0.0481691 0.0725072 +-0.108763 -0.0231475 +-0.250789 -0.0568415 +0.237699 0.00684397 +-0.475074 0.129913 +-0.035916 -0.0178936 +0.128861 -0.00432846 +0.0229418 0.10019 +-0.0251104 -0.0496572 +-0.176179 -0.657349 +-0.0294094 0.0542338 +-0.687638 -0.632442 +0.159509 0.930507 +0.201882 0.457078 +-0.0269996 0.000187493 +0.0339674 0.0283847 +0.428479 0.529935 +-0.0440332 -0.00187839 +-0.643658 0.046456 +0.181978 -0.458016 +-0.00410164 0.0249838 +-0.0666459 -0.0265635 +0.0070943 -0.0356708 +0.820914 0.0704153 +0.0890864 -0.129206 +-0.0381943 -0.0424868 +0.169673 0.0738666 +-0.00853281 0.158798 +-0.0317273 0.171642 +0.0106561 0.0222823 +-0.0546014 -0.140306 +-0.0135702 -0.0253697 +-0.0665997 -0.210502 +-0.0274326 -0.122675 +0.0191266 -0.106303 +0.0437179 0.0444629 +-0.00996016 0.0682061 +-0.100067 -0.0338598 +-0.052029 -0.0809313 +0.00800553 0.0336207 +-0.110378 0.290997 +-0.0534965 0.0460634 +-0.0159255 0.110346 +-0.152749 0.102508 +-0.00357658 0.0314745 +0.0980362 -0.115767 +-0.24562 -0.254292 +-0.18866 0.177393 +-0.158614 -0.215316 +0.00743668 -0.0820733 +0.372038 -0.256105 +-0.171675 -0.0100635 +0.0141307 0.00309762 +-0.139344 0.510509 +0.0193205 0.0892575 +-0.266064 -0.0484572 +0.0628837 -0.0864869 +0.013591 -0.0350352 +0.107279 -0.0655494 +0.0850893 0.0755109 +-0.0664612 -0.173017 +-0.519141 0.329764 +-0.0829555 0.00634493 +-0.0717441 -0.138376 +1.43176 -0.218892 +0.478438 -0.141218 +-0.0337748 0.0524644 +0.731285 -0.46801 +-0.0955464 -0.480032 +-0.00614607 0.211181 +1.70887 -0.698447 +-1.1125 -0.796228 +-0.311561 1.65087 +0.0115623 0.0298444 +-0.00626004 0.025094 +0.0174729 0.0202751 +-0.16805 0.403549 +0.0168682 0.00268077 +0.187745 -0.134688 +0.0839656 -0.0362273 +0.0805313 -0.0485365 +0.235114 -0.0493161 +0.00703112 0.157055 +0.0464315 -0.121919 +-0.0645254 0.64752 +0.0263925 0.00371779 +-0.0725075 -0.0709109 +0.0168967 -0.0653115 +-0.0385458 0.0241553 +0.0311406 -0.0307999 +0.00745151 -0.0618236 +-0.0291267 -0.191366 +-0.0378087 -0.170965 +0.119363 0.40936 +-0.071869 -0.00591132 +-0.0331182 0.177513 +-0.0606545 -0.0570308 +-0.19563 -0.0255531 +-0.0530482 -0.253608 +-0.162428 0.345 +-0.590856 -0.372059 +0.0773424 0.0998726 +-0.0263824 0.186237 +0.346498 -0.262323 +0.694883 0.851789 +0.0207014 0.0472728 +0.0827755 0.438742 +-0.166447 -0.241751 +-0.427684 -0.00133452 +0.13662 -0.0694532 +0.190908 0.101279 +0.0474965 0.168059 +-0.217645 -0.197431 +-0.0674277 -0.0663611 +-0.14939 -0.219892 +0.00197523 0.0696894 +-0.465934 0.397688 +0.507351 -0.18046 +0.0853405 0.00774836 +0.0347094 0.159354 +-0.109463 -0.209613 +-0.292456 -0.428309 +1.28343 -0.566158 +0.0171855 -0.0106956 +-0.125047 0.0708227 +0.0527515 0.150714 +-0.290551 0.0825295 +-0.0101395 -0.090796 +0.101487 0.00440571 +-0.0604715 -0.00747189 +0.0328739 -0.0734499 +0.631479 -1.18205 +0.322206 -0.110584 +-0.0157824 -0.0929599 +0.0200297 0.0170653 +0.866327 -0.42853 +-0.0170907 -0.312035 +0.0332471 -0.0539992 +0.0505259 0.184011 +0.0173786 0.105497 +-2.70324 0.269999 +-0.138099 -0.475655 +-0.0821976 -0.0726651 +0.0139316 0.0218313 +-0.0951258 -0.214075 +0.0494093 0.0392256 +0.285913 -0.29101 +0.263634 -0.306181 +0.0664196 0.0289431 +0.00562681 0.0516366 +0.0608806 0.249527 +0.0877992 0.12208 +-0.283919 0.216366 +0.668283 -0.0626397 +0.82121 -0.551286 +-0.00207417 0.157057 +0.0635867 -0.0644116 +0.1674 0.124734 +-0.0398694 -0.71489 +0.0121215 -0.0283324 +0.00898979 -0.155974 +-0.0241965 -0.121973 +-0.176248 -0.464236 +-0.0289549 -0.0452334 +0.00955041 0.00217573 +0.272411 -0.0294673 +0.134247 -0.107003 +0.190834 -0.0409046 +0.123886 0.151189 +-0.0120807 0.0110883 +0.0302477 -0.141416 +0.332162 -0.216005 +-0.117793 0.0920145 +0.0359833 -0.0154087 +-0.385184 -0.0841271 +0.0218162 -0.0204353 +0.328239 -1.1562 +0.103166 0.0604201 +0.192979 -0.0835251 +0.394892 0.131481 +0.0623455 0.00360498 +0.0799755 0.00231672 +0.0833133 0.0296072 +0.0908101 0.0274532 +-0.00412203 0.0204011 +0.0521244 -0.0881874 +0.0256401 0.16084 +-0.00777758 0.0279908 +-0.0713718 0.0141356 +0.0661885 0.0164246 +6.94246e-05 0.150853 +-0.936198 0.374268 +0.174383 0.12352 +-0.0998882 0.0832654 +-0.115486 -0.00976599 +0.220865 0.586414 +-0.121858 -0.183334 +0.224486 0.0883872 +0.104939 0.00809945 +0.0540607 -0.069095 +0.098044 0.0317625 +0.30302 -0.0903391 +-0.0228241 0.447514 +-0.0680227 0.102734 +-0.0168998 -0.00461734 +-0.0856424 0.196383 +0.0913611 0.0234713 +-0.0678182 -0.0120137 +0.127842 -0.0202394 +0.0710917 -0.0776074 +-0.216718 0.0072148 +-0.0877787 -0.296323 +-0.325425 -0.00628857 +0.0961065 -0.0775026 +0.590896 -0.00107093 +0.0753104 0.101953 +0.0652941 -0.0489796 +0.111579 -0.00108765 +0.00033131 -0.0996995 +-0.0708933 -0.00450201 +0.0280958 0.0282965 +-0.03952 -0.242143 +0.123365 -0.0490666 +0.0348505 -0.00258335 +-0.00197773 -0.0783074 +0.494777 0.360397 +0.0164992 0.0951404 +-0.0015898 -0.228355 +0.00956449 0.00687869 +0.0137742 -0.0276338 +0.090369 0.103608 +0.0321639 0.0271887 +0.0618458 -0.0904704 +0.00728761 -0.121161 +-0.494667 1.70366 +0.045807 -0.206052 +1.72481 -0.223043 +-0.0600878 -0.225474 +-0.0718385 -0.157417 +0.032807 -0.0303099 +-0.0449568 0.0315369 +-0.120153 0.0966771 +-0.0580331 -0.0562045 +0.0470432 -0.141937 +-0.0833774 -0.0481061 +-0.13244 -0.0400017 +-0.885471 -0.282795 +0.0237258 -0.071711 +-0.230419 -0.274878 +0.202712 -0.0720129 +0.181176 0.380056 +0.109682 0.109228 +0.0597185 -0.0393416 +0.177581 -0.104858 +-0.0124329 -0.059392 +-0.437136 -0.203975 +0.423922 -0.0393993 +0.808424 -0.166081 +-0.144146 0.18479 +-0.521313 -0.737971 +0.115523 -0.00399646 +-0.00992812 -0.00269605 +0.0838993 0.0148673 +-0.0212285 -0.0499143 +0.162297 0.102585 +-3.52585e-05 -0.022139 +-0.0285292 -0.00714229 +0.0540261 0.270851 +-0.0759282 -0.248592 +-0.0238999 0.112647 +-0.0106524 -0.204087 +-0.0723817 0.171945 +0.276756 -0.0612084 +0.586916 0.255413 +-0.0456855 0.0331692 +0.00201242 -0.0474711 +0.0480463 0.00477404 +0.0149367 0.0638382 +-0.0155824 -0.0136156 +0.11084 -0.351091 +0.0736689 -0.0618446 +0.0448826 0.124414 +0.0554515 -0.771066 +-0.200134 0.018653 +-0.446336 0.835132 +-0.0258489 0.14053 +-0.0238202 0.0149289 +0.53907 0.816841 +0.0550264 0.0586478 +-0.0308151 -0.0335861 +0.0267073 -0.00371623 +-0.0641426 -0.165299 +-0.0623138 -0.0202449 +0.0485422 -0.0285253 +-0.214415 0.383452 +0.000531868 -0.0398478 +0.235538 0.0688601 +-0.0239939 -0.0942411 +0.102159 0.0904046 +-0.221163 -0.0947597 +0.160934 -0.0899228 +0.0133405 0.180669 +-0.0298296 0.00882213 +0.0995376 0.209864 +0.0193684 0.0456101 +0.195444 0.202095 +-0.0323346 -0.00273521 +-0.175478 0.0658499 +0.0284063 -0.00151768 +-0.0318633 0.257701 +-1.07693 0.0632797 +0.0206702 -0.116294 +0.434878 0.816543 +-0.0164834 -0.0950889 +0.0417266 0.0287763 +-0.120077 -0.118364 +0.020592 -0.218476 +-0.038616 -0.0144479 +0.653643 0.159955 +0.138145 -0.00131952 +0.116091 -0.169935 +0.0682633 -0.147218 +0.157011 0.542724 +-0.123542 0.0249515 +-0.249852 0.474035 +-0.0117374 -0.0148152 +0.0107102 0.00354129 +0.322984 -0.393622 +-0.156331 -0.0179478 +-0.0838192 -0.0366643 +-0.0245402 0.0012637 +0.00117047 0.157319 +-0.115436 0.077041 +0.0437739 0.121724 +-0.180442 -0.112761 +-0.0258557 0.0297625 +0.00820027 -0.170418 +0.0581907 -0.00733377 +-0.123755 -0.0339424 +0.222943 -0.187631 +-0.0538287 -0.111378 +-0.23387 -0.460079 +-0.148699 0.395025 +0.0124782 0.0287271 +0.0558899 0.13079 +0.0495528 -0.00141444 +0.158812 -0.111323 +0.0131562 -0.0162438 +-0.125079 0.0859774 +0.526522 0.0194137 +0.0290853 -0.236207 +-0.526068 0.0403971 +0.297075 1.09273 +0.188398 0.317307 +-0.0414929 -0.0756556 +0.214284 0.273082 +-0.546669 -1.23622 +-0.047346 -0.00913943 +0.00313562 -0.0094919 +-0.187173 -0.0764188 +-0.0109485 -0.0493223 +0.00968775 -0.0199212 +0.0174079 -0.0901115 +-0.030981 0.112508 +0.0601128 -0.121568 +0.0186483 0.00188747 +0.351167 0.307862 +0.0254941 0.0945686 +0.013283 0.0155762 +-0.361613 0.0131128 +-0.00384257 0.00113159 +0.0914256 0.0784618 +0.0764807 -0.0911559 +0.0258946 0.0393792 +-0.186108 0.193533 +-0.00100689 -0.0786085 +0.0244279 0.0775434 +-0.130701 -0.187406 +-0.14872 -0.0501783 +-0.00711187 -0.00833595 +0.00265984 0.00189869 +0.196824 0.167347 +-0.162596 0.0448506 +1.01683 0.292819 +-0.028443 -0.00715177 +0.161289 -0.250966 +0.110418 0.0707651 +0.759502 0.208209 +0.019848 -0.000407961 +0.492779 -0.108562 +-0.105315 0.162037 +0.0644254 0.236359 +0.00869268 -0.118336 +0.234662 -0.198334 +0.156489 -0.149467 +0.0924825 -0.0631557 +-0.0418869 0.126001 +0.0145757 -0.494168 +0.176073 0.203251 +0.129971 0.0214245 +-0.249855 0.0972887 +-0.330487 0.308523 +0.151191 0.0304838 +0.899779 0.0781727 +0.111048 -0.0536621 +-0.0179431 0.0623894 +0.36957 0.727721 +-0.0372433 -0.0188153 +-0.0465923 0.0668101 +0.128947 -0.149512 +-0.179534 0.109541 +-0.0846409 0.0199442 +-0.219486 0.159877 +0.0339292 0.00882856 +0.0882184 0.0966977 +0.0831197 0.124819 +-0.0832909 0.101125 +-0.297098 0.0160071 +0.155939 -0.0130727 +-0.797977 -0.711248 +0.200272 0.0101388 +2.75829 0.0928265 +-0.10535 0.0954399 +-0.0190062 0.134559 +0.0538621 0.0106701 +1.59453 0.422682 +-0.191037 -0.0984122 +0.0163485 -0.00494995 +-0.136876 -1.4202 +0.0335999 0.0137967 +0.000444147 -0.113905 +-0.0924147 0.522855 +-0.224911 -0.293363 +0.104729 0.0210483 +-0.0473325 0.0602538 +-0.240569 -0.16514 +0.138841 0.0731459 +-0.0402846 -0.0505179 +0.0549978 -0.0754 +0.0668849 -0.0533307 +0.228395 0.077412 +0.0540656 -0.237981 +0.0329498 0.0225907 +-0.3086 -0.00845805 +-0.0555988 -0.0388443 +-0.147855 0.00107437 +-0.108842 0.323766 +-0.0302534 -0.14113 +0.0267024 -0.183096 +0.301771 0.102814 +0.0902499 0.0806517 +0.184256 0.108393 +0.0492846 -0.0270588 +0.0020095 0.0425787 +0.0259792 -0.301624 +-0.0823305 -0.0299869 +0.219069 0.0529001 +-0.0838702 0.115624 +-0.00761238 0.015116 +0.0858167 0.106526 +-0.164487 0.0886983 +-0.0201872 0.0189599 +0.237058 -0.0466433 +-0.00877148 0.0836511 +0.0263461 -0.147897 +-0.057341 0.211324 +-0.119535 -0.400627 +0.0546485 0.0339187 +-0.00428425 -0.0430365 +-0.114013 -0.0493643 +-0.00628135 0.022425 +0.0346187 0.0325679 +-0.16063 0.210266 +-0.00364873 0.00647188 +0.130933 0.0257971 +0.0622174 0.0444522 +0.036257 -0.0775806 +0.0314321 0.228372 +-0.00997396 0.0362854 +0.459714 0.504642 +-0.0783252 -0.0445439 +-0.130475 0.0521679 +0.0413139 0.0898037 +0.238205 0.0480703 +-0.0502631 0.0430492 +-9.92923e-05 0.0711734 +0.0654846 0.035557 +-0.0119937 -0.100448 +0.286966 0.0718403 +-0.00351614 0.00709246 +-0.262058 0.285566 +-0.478864 -0.844196 +-0.0765754 -0.137456 +0.0358491 0.158042 +0.249715 0.0129255 +0.08982 -0.0586377 +0.0188814 -0.0315921 +0.142686 0.0338673 +0.0539941 0.0331822 +1.12 -0.713867 +-0.0252543 -0.000205105 +-0.0886537 0.0982142 +0.230037 0.0583419 +0.721157 -0.0594423 +-0.0954707 -0.0208445 +-0.0724457 -0.0349863 +-0.0581122 0.141417 +-0.00885871 -0.000186483 +-0.100571 0.110772 +-0.52287 -2.09554 +0.0116001 -0.019912 +0.592567 0.0714468 +-0.0293883 -0.0179714 +-0.0754171 0.194644 +0.239133 0.110284 +0.246144 0.578663 +-0.161399 0.0375164 +0.0121477 0.145158 +0.0982582 -0.0346334 +-0.32797 0.141068 +0.0182414 0.026995 +-0.486465 0.163221 +0.0942042 0.455714 +-0.0211252 -0.154232 +-1.46814 -1.43403 +-0.0237957 -0.000576239 +0.139924 0.269477 +0.335473 1.04877 +0.109632 -0.0231911 +0.0510383 0.134415 +0.0617265 -0.11037 +0.0096624 -0.0100037 +0.147838 -0.00101336 +0.0163045 -0.00579359 +0.0431979 -0.132559 +-0.025504 0.0115455 +0.0356539 0.0369162 +0.0487537 -0.00960723 +-0.0850101 -0.0547837 +0.809202 0.220013 +-0.0709636 -0.162297 +-0.0184235 -0.179861 +1.86168 1.49651 +0.138473 -0.0149464 +0.140115 0.494635 +0.481526 0.386122 +-0.39635 -0.0387443 +0.150702 -0.178208 +-0.00804315 0.101754 +0.274833 -0.085313 +-0.142477 0.0587948 +0.139907 -0.475415 +0.197883 -0.108362 +-0.351583 -0.12004 +0.0252052 0.0273312 +0.299378 -0.162299 +0.0449212 -0.0105263 +-0.0699988 0.170236 +0.153711 -0.932886 +-0.125237 -0.25312 +0.5131 0.693515 +-0.125603 0.0209823 +-0.0576015 -0.145836 +-0.0617288 -0.0237622 +-0.0436946 0.143598 +-1.0876 -0.258778 +-0.233281 -0.130247 +0.0790854 0.00582082 +0.227929 -0.980736 +-0.529854 -0.257128 +-0.0424543 -0.0323139 +0.0136242 -0.0488461 +1.54094 -0.0702802 +-0.0479141 -0.106616 +-0.000809406 0.00703496 +0.160091 -0.0699552 +-0.043062 0.00526951 +0.35755 -0.0253448 +-0.0755977 0.152323 +0.143371 -0.119316 +-0.0192385 -0.0507646 +0.392282 0.325281 +-0.302478 -0.0603069 +-0.915086 0.220436 +0.386156 -0.203208 +1.28822 -0.885331 +0.0806949 -1.12389 +-0.0305462 0.0740915 +0.0319361 -0.0473077 +0.231545 1.07518 +0.051679 0.0147201 +0.0140504 0.0392303 +-0.149036 0.339348 +0.0764748 -0.0928621 +0.106659 -0.721671 +0.00376665 0.060025 +-0.0546469 0.0158514 +0.559679 0.359936 +-0.0255563 -0.0549393 +0.357597 0.940511 +-0.0760642 -0.0813998 +0.379684 -0.225927 +0.0215455 0.113502 +0.161525 -0.0674458 +0.0757148 -0.104914 +-0.217283 -0.0537218 +0.0285289 0.00388838 +-0.0410136 0.032186 +0.172995 -0.0243765 +-0.009295 -0.454976 +-0.0354356 0.0209451 +-0.0873832 0.0212961 +-0.0836283 0.0388745 +-0.142357 -0.588732 +0.138358 -0.0510531 +0.385932 -0.19474 +0.154719 0.688855 +-0.576329 0.249581 +0.188975 0.295482 +-0.331223 0.131483 +-0.0223607 0.251577 +0.0431343 0.138599 +-0.145555 -0.417578 +-0.0728193 -0.0809009 +-0.0171941 0.0397078 +-0.317964 -0.0658652 +-0.0283779 -0.162748 +0.0945318 0.0396346 +-0.174688 -0.24321 +0.0213206 -0.361629 +-0.0205976 0.0887377 +-0.164961 0.438462 +0.122816 -0.0351013 +-0.0358637 -0.161376 +0.0276992 0.0273168 +-0.118226 0.176135 +0.00363074 0.111414 +-0.0380409 0.027409 +-0.282838 0.208513 +0.0427683 -0.145231 +0.690545 -0.195345 +-0.0613585 0.328167 +0.705166 -0.717562 +0.0262438 0.128494 +-0.613237 -0.586952 +0.0111407 0.0406376 +-0.0275824 -0.048684 +0.160589 0.0545217 +0.0479834 0.115787 +-0.0655506 0.0608818 +-0.0152436 -0.0686787 +0.0164439 -0.173581 +0.099964 0.0733618 +0.0564588 0.0086228 +-0.167286 0.345513 +-0.108457 0.199066 +0.00670331 -0.0550036 +-0.166252 0.150407 +0.0493861 0.0784193 +-0.167046 -0.115018 +0.0933922 1.73022 +0.13619 0.0108718 +0.0151232 0.1432 +-0.107138 0.0388955 +-0.178885 0.0557263 +0.109501 0.146638 +0.0450376 -0.00616738 +0.175914 -0.0614084 +0.221986 -0.153613 +0.214253 -0.262351 +0.0138913 -0.0435565 +0.0247951 -0.0660914 +-0.340214 -0.064441 +0.0332354 -1.58632 +0.0788763 0.44775 +-0.0627315 -0.207521 +-0.047856 0.195352 +-0.142467 0.00757029 +0.875389 -0.116364 +0.0111623 -0.00302715 +0.0212308 0.041785 +-0.113211 -0.614025 +-0.122381 0.03861 +0.864582 0.160989 +0.0776424 0.157693 +-0.0628825 -0.0256501 +-0.0562568 -0.0373893 +-0.157724 -0.399304 +-0.0194143 -0.293318 +0.239695 0.458714 +-0.0179391 0.0334504 +0.0740752 0.178016 +-0.199312 -0.174505 +0.0438638 0.0367487 +0.131007 -0.208026 +0.182657 0.601151 +0.045282 0.18832 +-0.0393825 0.132742 +-0.00135247 -0.0299445 +0.685687 -0.263867 +0.126239 0.0158959 +-0.153522 -0.183585 +0.694443 0.313355 +0.115062 0.281494 +0.0166139 -0.0515866 +-0.00349011 0.0315044 +0.0600067 0.0894951 +-0.0466237 0.0109785 +0.0247485 -0.246361 +0.344064 0.346434 +-0.122511 -0.202496 +0.323572 0.00658746 +0.249958 0.180142 +-0.0144661 0.0299972 +-1.23809 -0.267967 +-0.59662 0.199941 +-0.068585 -0.025274 +-0.0843942 0.0453579 +-0.425036 -0.205026 +0.14614 -0.0429895 +-0.0163827 0.110627 +0.119748 0.0525022 +0.113278 0.0701457 +-0.222787 -0.477853 +0.110182 0.0581304 +-0.838844 -0.0389699 +-0.27324 -0.0370701 +-0.377874 -0.129264 +-0.0142177 0.0349073 +-0.10441 -0.203641 +0.0267033 0.278966 +0.011299 0.0444756 +-0.0770888 0.0353545 +-0.129122 -0.044935 +-0.0669601 0.0268216 +-0.107047 -0.236392 +0.715367 -0.591676 +0.0449511 -0.0785236 +0.0421141 0.0245611 +0.0486014 0.0231257 +-0.366144 0.410243 +-0.32358 0.734275 +0.596994 0.61247 +-0.155056 -0.0786926 +0.201476 0.129879 +0.0919765 0.42432 +-0.0648974 -0.126529 +-0.124069 0.41634 +-0.0130843 0.0181808 +0.10748 -0.0747298 +0.0490763 -0.279474 +0.0110516 -0.059557 +-0.385911 1.51858 +0.224729 0.00598718 +-0.210424 -0.0443729 +-0.0520336 -0.757965 +-0.0579761 0.108745 +0.0112749 0.0689753 +-0.0293139 -0.0333001 +0.0649929 -0.00843633 +-0.0664351 -0.158988 +-0.00740108 -0.000453469 +-0.00381194 -0.0225288 +0.0900347 0.0598345 +-0.00532732 -0.0203319 +0.100528 0.086852 +-0.00884402 0.0711911 +0.237279 -0.154503 +0.0397627 0.0432367 +-0.0577788 -0.111541 +-0.0124983 -0.136582 +-0.0528634 -0.0457609 +-0.142808 -0.0553785 +0.0300456 -0.0917626 +-0.156082 0.0230632 +-0.00649435 -0.00405344 +0.471731 0.0882418 +0.251268 -0.156286 +-0.110879 -0.0990252 +-0.323539 -0.438666 +0.110247 0.154006 +0.0104913 0.228462 +0.967865 -0.236783 +0.0482748 0.0238212 +0.133105 0.0320566 +0.0718992 -0.167549 +0.0325779 -0.0231836 +0.202181 -0.0618804 +-0.251602 0.246416 +-0.0397951 0.220387 +-0.204516 -0.0561809 +-0.265434 0.0567665 +0.247044 -0.0746581 +0.142415 0.202177 +-0.123223 -0.0288146 +-0.320774 0.26702 +-0.0746553 0.297602 +-0.249538 0.554153 +0.475298 -0.0905447 +-0.0414397 -0.0791189 +-0.148538 -0.126007 +0.0388655 -0.0731033 +-0.244639 1.44869 +0.524642 -0.355674 +0.0687598 0.0319974 +-0.528587 -0.397972 +0.00127117 0.0930828 +0.586205 -0.129759 +-0.00416281 0.00561415 +-0.806275 0.0129484 +-0.0700797 0.0291671 +-0.0132418 0.266398 +0.322554 0.302091 +0.0517174 -0.000657107 +-1.66284 0.867525 +0.0446349 -0.232483 +0.194931 -0.0817378 +-0.0996733 0.0177463 +0.0797154 0.0156863 +-0.0105369 -0.0338641 +0.198528 -0.0557158 +0.0785123 0.0532538 +0.0155028 -0.325954 +-0.345736 -0.920651 +-0.144359 0.0126227 +0.0463931 -0.197494 +0.0193667 -0.0420316 +0.309195 -0.0507808 +0.0174141 -0.0667601 +-0.0546215 0.0371565 +-0.0940531 -0.0916049 +0.0703631 0.0828675 +0.052569 0.0593809 +-0.00650854 -0.0314971 +0.611517 0.539365 +-0.259059 -0.775919 +0.249305 0.556933 +0.0699955 0.00460914 +0.363664 -0.00836764 +-0.00349096 -0.119403 +-0.0928126 0.0563121 +-0.0571372 -0.163295 +-0.698822 0.414402 +0.0971409 -0.0277742 +-0.0216455 0.133893 +0.190047 0.106257 +-0.10929 -0.0142709 +-0.0150214 -0.0149824 +0.126505 -0.114638 +0.0387853 0.0464991 +0.0273244 -0.0359518 +-0.246862 -0.262778 +-0.0110494 0.0860528 +-0.197446 -0.124179 +-0.659916 -1.36991 +-0.0187578 0.0349316 +-0.906197 -0.0733567 +0.880165 0.643019 +-0.219313 0.143351 +-0.00538283 -0.558605 +0.206401 -0.243952 +-0.5993 0.105182 +-0.0278903 -0.161177 +0.0407965 -0.00293327 +-0.0238318 0.184815 +0.0466536 0.0600757 +0.0821079 0.0773798 +0.0269702 -0.882424 +-0.00905363 -0.0406786 +0.084476 0.0365811 +0.019186 0.0328356 +0.0415935 -0.351373 +0.0252237 0.00490377 +-0.127491 0.102748 +0.00417804 -0.0143256 +0.714642 0.655598 +-0.0203824 -0.000990853 +0.0548325 0.0433385 +0.074468 0.291225 +-0.679315 -0.936768 +0.130948 0.124784 +-0.271287 -0.491317 +-0.0833701 -0.39209 +-0.207505 0.0323851 +0.11311 -0.720468 +-0.037793 0.0675638 +0.0211663 -0.0211209 +0.427232 0.00372898 +-0.0650195 -0.0816194 +-0.612818 -0.0269589 +-1.72398 -1.09605 +0.0376406 -0.0876379 +0.0470479 0.0996775 +-0.11001 -0.544327 +-0.00929481 -0.0133288 +-0.0473021 0.260132 +0.140657 -0.16781 +-0.0258738 -0.15754 +0.0931475 0.0413245 +-2.51549 -1.23875 +-0.586895 0.897939 +0.138438 -1.12393 +-0.00448117 0.00453841 +-0.0239781 -0.206088 +-0.110053 0.126279 +-0.0119043 -0.0173557 +0.0322543 0.0534948 +0.0644352 -0.27473 +0.0173144 0.136366 +0.12363 -0.235439 +0.0190948 -0.156163 +0.446387 -0.177006 +0.122744 0.00573334 +0.133355 -0.119722 +-0.0288561 -0.110768 +-0.13818 0.0186303 +0.337876 0.70464 +0.450648 0.229409 +-0.0551171 0.136027 +0.0913334 -0.220714 +0.017142 0.0133139 +-0.29474 0.127389 +0.315683 0.032692 +0.00959266 -0.0119432 +0.179187 0.119061 +-0.307735 0.3483 +-0.020254 0.00189671 +0.931472 -0.48604 +0.230471 0.0435611 +-0.019228 -0.00262681 +0.0652483 0.16789 +-0.0659998 0.255298 +-0.0569594 -0.009103 +-0.0988955 -0.154387 +0.0230425 0.18735 +-0.180018 0.211968 +0.239877 -0.114339 +-0.262308 -0.363413 +0.280094 0.401235 +0.0196397 -0.0384768 +-0.0778899 -0.0101198 +0.0100597 -0.0144181 +-0.467647 -0.060538 +-0.156427 -0.0375884 +0.0515596 0.369886 +0.518616 -0.027364 +-0.0392196 0.310727 +0.0836673 0.0165057 +-0.363632 0.294353 +0.045554 0.00114951 +0.303654 0.129228 +-0.170125 0.0262298 +0.0293009 -0.556934 +-0.199237 -0.628862 +-0.172998 -0.327448 +0.0350778 -0.169715 +-0.027103 0.0312291 +0.0781819 0.124251 +0.0621344 0.0596029 +-0.197771 -0.129545 +0.0379911 -0.0295523 +1.8664 0.32788 +0.0912209 -0.062752 +-0.0148124 -0.121965 +0.0478461 0.061463 +0.0264197 -0.0249739 +-0.00175476 0.0914811 +0.294684 -0.0384788 +-0.116576 -0.131989 +-0.121603 -0.17807 +0.0170537 -0.0780531 +1.15548 -1.37844 +0.0913939 0.0114949 +0.403247 0.548409 +-0.655739 -0.0502014 +0.0238021 0.556281 +-0.0589909 -0.480203 +-0.00221774 -0.0428874 +0.0127039 -0.00495657 +-0.095563 0.0658161 +-0.158836 0.293717 +-0.114612 -0.137684 +0.530103 0.702348 +0.134107 0.251016 +-0.140951 -0.414585 +-0.101367 0.0887282 +-0.0344599 0.275548 +-0.0384501 0.0481158 +0.0401104 -0.037499 +-0.0975153 -0.101502 +0.0350507 0.0621578 +-0.0193326 -0.0558167 +0.0791749 0.0996079 +0.406559 -0.226733 +-1.01818 -0.715323 +-0.123752 0.148803 +0.125736 0.0576081 +-0.0132285 -0.0679201 +0.173469 0.0383501 +0.536403 -0.11033 +-0.152917 0.262048 +0.124005 -1.2504 +0.0136383 -0.0297214 +-0.268197 0.288433 +-0.0465605 0.0648447 +0.0663444 -0.557473 +1.00469 0.252459 +0.0710818 -0.0055297 +-0.326267 0.255324 +0.616761 0.751907 +-0.189931 -0.638069 +0.0571793 0.0165543 +-0.169699 0.0956199 +0.399609 -0.602752 +0.0795504 -0.126772 +0.103486 -0.226309 +-0.708614 -0.181171 +-0.115953 0.0525381 +0.675645 0.321917 +0.0497015 -0.790624 +0.032563 -0.0406896 +-0.088231 -0.00220744 +0.118842 -0.0907279 +-0.256409 0.377291 +0.634004 -0.646553 +-0.228653 -0.0673706 +0.242637 0.169601 +-0.0937769 -0.130387 +0.0110125 -0.0129174 +-0.0507697 -0.0721235 +-0.117498 0.131392 +-0.0175521 -0.0206286 +1.72657 -0.108351 +0.320325 0.36449 +-0.0436076 -0.372594 +0.0191238 0.195085 +-0.232366 -0.220951 +2.3874 1.09891 +0.381661 -0.888069 +0.27909 0.0537601 +-0.0325722 -0.0110048 +-0.141863 0.021808 +-0.81907 -0.0180822 +0.163159 0.332731 +0.111785 0.159098 +0.11605 0.135301 +-0.00414977 0.0132606 +0.0809722 0.0203659 +0.0636276 -0.0123062 +0.0410491 0.0216176 +0.590162 -0.504944 +0.0842513 -0.0784482 +-0.322566 -0.114221 +-0.264424 -0.275712 +-0.367026 -0.600489 +-0.0336553 0.116696 +-0.299691 -0.129868 +0.0834271 -0.0678106 +0.0165691 -0.077695 +0.313681 0.0141215 +0.123088 0.020374 +0.177704 0.0219236 +-0.0441987 -0.0303552 +0.226876 0.664549 +-0.506601 -1.09137 +-0.385617 -0.281472 +0.323229 0.409756 +-0.53418 -0.0703629 +0.139619 0.0564994 +1.25425 -0.362762 +-0.137821 0.236177 +0.378453 -0.160676 +0.0556834 -0.49659 +-0.17752 0.105582 +-0.169526 0.0826353 +-1.30465 -0.385558 +-0.0624052 -0.129945 +0.020425 0.183422 +-0.0707214 -0.00185028 +0.0409917 -0.0147785 +0.22896 -0.372334 +-0.00130461 0.117672 +-0.239523 -0.0445942 +-0.0805483 -0.0294007 +-0.430814 -0.274114 +0.007169 -0.183121 +0.0961809 -0.0553292 +0.178726 -0.118215 +-0.400984 -0.178304 +-0.301505 0.398105 +-0.0161903 -0.0315382 +0.0694608 0.254899 +0.1438 0.0242356 +-0.0768961 0.0263575 +0.192654 0.0215777 +0.219638 0.0569284 +-0.00989822 -0.0379286 +0.0336014 -0.0661281 +0.018743 0.106428 +0.187314 0.0272618 +0.0113541 0.0481237 +0.278575 0.232306 +0.00150193 0.175952 +-0.00498554 -0.0137376 +0.31085 -0.208371 +0.0980351 -0.00372246 +0.0263189 0.225841 +-0.726224 0.23056 +0.355278 0.354966 +0.00246411 0.0511733 +-0.32287 -0.131012 +0.0334573 -0.0774847 +-0.0141002 0.0772374 +-0.017462 -0.123729 +0.0309619 0.304765 +-0.150669 0.513948 +-0.0373952 0.00763662 +-0.039782 -0.137795 +0.102508 -0.171526 +0.0203436 0.0544186 +0.18571 0.272018 +0.001159 0.00192553 +-0.10522 0.201338 +0.118236 0.206429 +0.267632 -0.164852 +1.66078 1.19009 +-0.168193 -0.380243 +-0.0348284 -0.0168413 +0.13723 0.0166048 +0.200117 0.0526267 +0.000209673 -0.0205713 +0.0343367 -0.614588 +0.124581 -0.0493907 +0.32837 -0.30441 +-0.12415 0.0399824 +-0.129607 0.11937 +0.273996 0.575534 +-0.096972 2.65716e-05 +0.421879 -0.0315594 +0.0326768 -0.146329 +0.0240691 0.0192565 +-0.0708873 -0.198817 +0.080131 0.424639 +-0.0705564 -0.0392549 +0.225924 -0.589671 +-0.0170612 0.148083 +0.20887 0.0908414 +-0.00866865 -0.0450467 +-0.00653568 0.0783515 +-0.13161 0.0688402 +0.0339163 -0.0668055 +-0.0264495 0.202447 +0.0906933 0.0447439 +-0.00625976 -0.031595 +0.111858 -0.201734 +1.16563 0.12647 +0.0187129 0.223828 +0.194704 -0.256246 +-0.044381 -0.939916 +-0.0142118 -0.0731179 +-0.0486302 0.00985313 +-0.12173 0.0169418 +0.290617 -0.618736 +0.0718541 0.150035 +0.00234923 -0.135377 +-0.890085 -0.308618 +0.846594 -1.53661 +-0.0392133 0.0887448 +-0.12135 -0.403798 +-0.0282586 -0.0985113 +-0.276314 0.617939 diff --git a/run-train.sh b/run-train.sh index bcdf797..7446375 100644 --- a/run-train.sh +++ b/run-train.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash DATASET="DegreeData" -SETTINGS="distmult.exp" +SETTINGS="complex.exp" SCRIPT_DIR=$(dirname $(readlink -f $0)) diff --git a/settings/complex.exp b/settings/complex.exp new file mode 100644 index 0000000..914a1a7 --- /dev/null +++ b/settings/complex.exp @@ -0,0 +1,28 @@ +[Encoder] + Name=embedding + +[Decoder] + Name=complex + RegularizationParameter=0.01 + +[Shared] + CodeDimension=200 + +[Optimizer] + MaxGradientNorm=1 + ReportTrainLossEvery=100 + + [EarlyStopping] + CheckEvery=500 + + [Algorithm] + Name=Adam + learning_rate=0.01 + +[General] + NegativeSampleRate=1 + GraphSplitSize=15000 + + +[Evaluation] + Metric=MRR \ No newline at end of file diff --git a/settings/gcn_basis.exp b/settings/gcn_basis.exp index 1f6f003..36a2cfe 100644 --- a/settings/gcn_basis.exp +++ b/settings/gcn_basis.exp @@ -1,6 +1,6 @@ [Encoder] Name=gcn_basis - DropoutKeepProbability=0.9 + DropoutKeepProbability=1.0 InternalEncoderDimension=50 NumberOfBasisFunctions=2 NumberOfLayers=1 @@ -15,14 +15,14 @@ RegularizationParameter=0.01 [Shared] - CodeDimension=50 + CodeDimension=100 [Optimizer] MaxGradientNorm=1 ReportTrainLossEvery=50 [EarlyStopping] - CheckEvery=250 + CheckEvery=500 BurninPhaseDuration=100 [Algorithm] @@ -31,7 +31,7 @@ [General] NegativeSampleRate=1 - GraphSplitSize=3500 + GraphSplitSize=2000 [Evaluation] Metric=MRR \ No newline at end of file