Skip to content

Commit

Permalink
Resolved #19. Added single experiment script.
Browse files Browse the repository at this point in the history
  • Loading branch information
chanlevan committed Mar 6, 2019
1 parent cb43842 commit cd02c3e
Show file tree
Hide file tree
Showing 107 changed files with 381 additions and 793 deletions.
Empty file modified .github/ISSUE_TEMPLATE/bug_report.md 100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/feature_request.md 100644 → 100755
Empty file.
10 changes: 3 additions & 7 deletions .gitignore 100644 → 100755
Expand Up @@ -112,12 +112,8 @@ venv.bak/
# pycharm
.idea/

#chan-hdt
model
.pytest_cache
output.txt
unittest_save_and_restore_models
playground

#vim
.swp

# experiments
experiments/config_test.json
Empty file modified LICENSE 100644 → 100755
Empty file.
Empty file modified MANIFEST.in 100644 → 100755
Empty file.
44 changes: 33 additions & 11 deletions README.md 100644 → 100755
Expand Up @@ -128,17 +128,39 @@ setx AMPLIGRAPH_DATA_HOME /YOUR/PATH/TO/datasets
```


## Predictive Power Evaluation (MRR Filtered)

| | WN18 | FB15k | FB15k | WN18RR |
|----------|------|-------|-------|--------|
| TransE | .?? | .?? | .?? | .?? |
| DistMult | .?? | .?? | .?? | .?? |
| ComplEx | .?? | .?? | .?? | .?? |
| HolE | .?? | .?? | .?? | .?? |
| RotatE | .?? | .?? | .?? | .?? |


## Predictive Power Evaluation

#### FB15K
|Model|MR|MRR|H@1|H@3|H@10|
|-----|--|---|---|---|----|
|TransE|159.02|0.47|0.35|0.55|0.72|
|DistMult|223.39|0.77|0.73|0.81|0.85|
|ComplEx|221.21|0.79|0.76|0.82|0.85|
|HolE|245.28|0.78|0.72|0.82|0.86|

#### WN18
|Model|MR|MRR|H@1|H@3|H@10|
|-----|--|---|---|---|----|
|TransE|.??|.??|.??|.??|.??|
|DistMult|761.78|0.76|0.62|0.90|0.96|
|ComplEx|656.88|0.96|0.96|0.97|0.97|
|HolE|587.58|0.96|0.95|0.97|0.97|

#### WN18RR
|Model|MR|MRR|H@1|H@3|H@10|
|-----|--|---|---|---|----|
|TransE|.??|.??|.??|.??|.??|
|DistMult|13047.16|0.41|0.39|0.42|0.46|
|ComplEx|15547.66|0.43|0.40|0.43|0.48|
|HolE|13364.40|0.43|0.41|0.44|0.48|

#### FB15K-237
|Model|MR|MRR|H@1|H@3|H@10|
|-----|--|---|---|---|----|
|TransE|.??|.??|.??|.??|.??|
|DistMult|.??|.??|.??|.??|.??|
|ComplEx|.??|.??|.??|.??|.??|
|HolE|.??|.??|.??|.??|.??|

## Documentation

Expand Down
Empty file modified ampligraph/__init__.py 100644 → 100755
Empty file.
Empty file modified ampligraph/datasets/__init__.py 100644 → 100755
Empty file.
Empty file modified ampligraph/datasets/datasets.py 100644 → 100755
Empty file.
Empty file modified ampligraph/evaluation/__init__.py 100644 → 100755
Empty file.
Empty file modified ampligraph/evaluation/metrics.py 100644 → 100755
Empty file.
Empty file modified ampligraph/evaluation/protocol.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/__init__.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/loss_functions.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/misc.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/model_utils.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/models.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/pool_functions.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/regularizers.py 100644 → 100755
Empty file.
Empty file modified ampligraph/latent_features/score_functions.py 100644 → 100755
Empty file.
Empty file modified docs/Makefile 100644 → 100755
Empty file.
Empty file modified docs/ampligraph.datasets.rst 100644 → 100755
Empty file.
Empty file modified docs/ampligraph.evaluation.rst 100644 → 100755
Empty file.
Empty file modified docs/ampligraph.latent_features.rst 100644 → 100755
Empty file.
Empty file modified docs/api.rst 100644 → 100755
Empty file.
Empty file modified docs/biblio.rst 100644 → 100755
Empty file.
Empty file modified docs/changelog.md 100644 → 100755
Empty file.
Empty file modified docs/conf.py 100644 → 100755
Empty file.
Empty file modified docs/contacts.md 100644 → 100755
Empty file.
Empty file modified docs/dev.md 100644 → 100755
Empty file.
Empty file modified docs/examples.md 100644 → 100755
Empty file.
95 changes: 63 additions & 32 deletions docs/experiments.rst 100644 → 100755
Expand Up @@ -5,41 +5,72 @@ Performance
Predictive Performance
----------------------

We report the filtered MRR on the most common datasets used in literature.

+----------+------+-------+-------+--------+
| | WN18 | FB15k | FB15k | WN18RR |
+----------+------+-------+-------+--------+
| TransE | .?? | .?? | .?? | .?? |
+----------+------+-------+-------+--------+
| DistMult | .?? | .?? | .?? | .?? |
+----------+------+-------+-------+--------+
| ComplEx | .?? | .?? | .?? | .?? |
+----------+------+-------+-------+--------+
| HolE | .?? | .?? | .?? | .?? |
+----------+------+-------+-------+--------+
| RotatE | .?? | .?? | .?? | .?? |
+----------+------+-------+-------+--------+

The above results have been obtained with the following hyperparameters values:

+----------+-----------------+
| | Hyperparameters |
+----------+-----------------+
| TransE | .?? |
+----------+-----------------+
| DistMult | .?? |
+----------+-----------------+
| ComplEx | .?? |
+----------+-----------------+
| HolE | .?? |
+----------+-----------------+
| RotatE | .?? |
+----------+-----------------+
We report the filtered MR, MRR, Hit at 1, 3 and 10 on the most common datasets used in literature.

FB15K
-----

+----------+--------+------+------+------+------+
| Model | MR | MRR | H @ 1| H @ 3|H @ 10|
+----------+--------+------+------+------+------+
| TransE | 159.02 | 0.47 | 0.35 | 0.55 | 0.72 |
+----------+--------+------+------+------+------+
| DistMult | 223.39 | 0.77 | 0.73 | 0.81 | 0.85 |
+----------+--------+------+------+------+------+
| ComplEx | 221.21 | 0.79 | 0.76 | 0.82 | 0.85 |
+----------+--------+------+------+------+------+
| HolE | 245.28 | 0.78 | 0.72 | 0.82 | 0.86 |
+----------+--------+------+------+------+------+

WN18
----

+----------+--------+------+------+------+------+
| Model | MR | MRR | H @ 1| H @ 3|H @ 10|
+----------+--------+------+------+------+------+
| TransE | .?? | .?? | .?? | .?? | .?? |
+----------+--------+------+------+------+------+
| DistMult | 761.78 | 0.76 | 0.62 | 0.90 | 0.96 |
+----------+--------+------+------+------+------+
| ComplEx | 656.88 | 0.96 | 0.96 | 0.97 | 0.97 |
+----------+--------+------+------+------+------+
| HolE | 587.58 | 0.96 | 0.95 | 0.97 | 0.97 |
+----------+--------+------+------+------+------+

WN18RR
------
We removed 187 triples containing unseen entities on test dataset.

+----------+----------+------+------+------+------+
| Model | MR | MRR | H @ 1| H @ 3|H @ 10|
+----------+----------+------+------+------+------+
| TransE | .?? | .?? | .?? | .?? | .?? |
+----------+----------+------+------+------+------+
| DistMult | 13047.16 | 0.41 | 0.39 | 0.42 | 0.46 |
+----------+----------+------+------+------+------+
| ComplEx | 15547.66 | 0.43 | 0.40 | 0.43 | 0.48 |
+----------+----------+------+------+------+------+
| HolE | 13364.4 | 0.43 | 0.41 | 0.44 | 0.48 |
+----------+----------+------+------+------+------+

FB15K-237
---------
We removed 27 triples containing unseen entities on test dataset.

+----------+-----+-----+-----+-----+------+
| Model | MR | MRR |H @ 1|H @ 3|H @ 10|
+----------+-----+-----+-----+-----+------+
| TransE | .?? | .?? | .?? | .?? | .?? |
+----------+-----+-----+-----+-----+------+
| DistMult | .?? | .?? | .?? | .?? | .?? |
+----------+-----+-----+-----+-----+------+
| ComplEx | .?? | .?? | .?? | .?? | .?? |
+----------+-----+-----+-----+-----+------+
| HolE | .?? | .?? | .?? | .?? | .?? |
+----------+-----+-----+-----+-----+------+

Results in the table above can be reproduced by running the script below:
``$ ./predictive_performance.py -i dataset -m model``
``$ ./predictive_performance.py -d dataset -m model``



Expand Down
Empty file modified docs/generated/ampligraph.datasets.load_ICEWS.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_fb13.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_fb15k.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_fb15k_237.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_from_csv.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_from_ntriples.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_from_rdf.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_wn11.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_wn18.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_wn18rr.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.datasets.load_yago3_10.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.create_mappings.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.evaluate_performance.rst 100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.hits_at_n_score.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.mar_score.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.mrr_score.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.quality_loss_mse.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.rank_score.rst 100644 → 100755
Empty file.
Empty file.
Empty file modified docs/generated/ampligraph.evaluation.to_idx.rst 100644 → 100755
Empty file.
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.ComplEx.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.DistMult.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.EmbeddingModel.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.HolE.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.L1Regularizer.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.L2Regularizer.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.Loss.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.NLLLoss.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.NoRegularizer.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.PairwiseLoss.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.Regularizer.rst 100644 → 100755
Empty file.
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.TransE.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.restore_model.rst 100644 → 100755
Empty file.
Empty file modified docs/generated/ampligraph.latent_features.save_model.rst 100644 → 100755
Empty file.
Empty file modified docs/img/arch.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/concept_embeddings_wordnet3_1_v0_2.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/kg_lp.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/kg_lp_step1.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/kg_lp_step2.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/kg_new.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/img/pipeline.png 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/index.rst 100644 → 100755
Empty file.
Empty file modified docs/install.md 100644 → 100755
Empty file.
Empty file modified docs/references.bib 100644 → 100755
Empty file.
11 changes: 0 additions & 11 deletions experiments/How-to-run.md

This file was deleted.

44 changes: 44 additions & 0 deletions experiments/config.json
@@ -0,0 +1,44 @@
{
"CUDA_VISIBLE_DEVICES": "1",
"UNSEEN_DATASETS": ["WN18RR", "FB15K-237"],
"load_function_map": {
"WN18": "load_wn18",
"FB15K": "load_fb15k",
"FB15K-237": "load_fb15k_237",
"WN18RR": "load_wn18rr"
},
"model_name_map": {
"TRANSE": "TransE",
"COMPLEX": "ComplEx",
"DISTMULT": "DistMult",
"HOLE": "HolE"
},

"hyperparams" : {
"FB15K":{
"TRANSE": {"batches_count": 10, "epochs": 4000, "k": 150, "eta": 5, "loss": "pairwise", "loss_params": {"margin": 0.5}, "embedding_model_params": {"norm": 1}, "regularizer": "L2", "regularizer_params": {"lambda": 0.0001}, "optimizer": "adam", "optimizer_params": {"lr": 0.0001}, "verbose": false, "seed": 0},
"DISTMULT": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false},
"COMPLEX": {"batches_count":100,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params":{"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":true},
"HOLE": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false}
},
"WN18":{
"TRANSE": null,
"DISTMULT": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "nll","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005}, "verbose": false},
"COMPLEX": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "nll","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false},
"HOLE": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false}
},
"WN18RR":{
"TRANSE": null,
"DISTMULT": {"batches_count":25,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false},
"COMPLEX": {"batches_count":10,"seed":0,"epochs":4000, "k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "nll","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005}, "verbose":false},
"HOLE": {"batches_count":50,"seed":0,"epochs":4000,"k":200,"eta":20,"regularizer":"None","regularizer_params" : {},"loss": "self_adverserial","loss_params": {"margin":1},"optimizer":"adam","optimizer_params":{"lr":0.0005},"verbose":false}
},
"FB15K-237":{
"TRANSE": {"batches_count": 10, "epochs": 3000, "k": 150, "eta": 10, "loss": "nll", "embedding_model_params": {"normalize_ent_emb": true}, "regularizer": "None", "regularizer_params": {"lambda": 0.0001}, "optimizer": "adam", "optimizer_params": {"lr": 0.0005}, "verbose": false, "seed": 0},
"DISTMULT": null,
"COMPLEX": null,
"HOLE": null
}
},
"no_early_stopping": ["FB15K_TRANSE"]
}
30 changes: 0 additions & 30 deletions experiments/grid.json

This file was deleted.

77 changes: 0 additions & 77 deletions experiments/grid_search_exp.py

This file was deleted.

25 changes: 0 additions & 25 deletions experiments/input.json

This file was deleted.

0 comments on commit cd02c3e

Please sign in to comment.