Skip to content

Commit

Permalink
few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Mozart committed Mar 26, 2024
1 parent d1abfdf commit e1f045a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

Knowledge graph embedding has shown to be succesfull when using divisional algebras ($\mathbb{R}$, $\mathbb{C}$, $\mathbb{Q}$, etc..) as these space are useful to model complex relations and pattern in a KG dataset. However, it exists no universal space to perform the embedding for all datasets as the space is congruent to the existing knowledge. Therefore, it can be difficult to decide, given a KG dataset in which space we will compute the embeddings.

One existing approach **[(Keci)](https://link.springer.com/chapter/10.1007/978-3-031-43418-1_34)** already tackle this problem by performing the embedding in a Clifford Algebra $Cl_{p,q}(\mathbb{R})$. This approach already generalize over baselines such as DistMult, ComplEx etc... but cannot generalize over approaches based on dual numbers. To tackle this, we developped our approach DeCaL which performs the embeddings into a degenerate Clifford Algebra $Cl_{p,q,r}(\mathbb{R})$. These spaces, allows generalizing over approaches based on dual numbers (which cannot be modelled using $Cl_{p,q}$) and capturing patterns that emanate from the absence of higher-order interactions between real and complex parts of entity embeddings.
One existing approach **[(Keci)](https://link.springer.com/chapter/10.1007/978-3-031-43418-1_34)** already tackle this problem by performing the embedding in a Clifford Algebra $Cl_{p,q}(\mathbb{R})$. This approach already generalize over baselines such as DistMult, ComplEx etc... but cannot generalize over approaches based on dual numbers. To tackle this, we developped our approach DeCaL which performs the embeddings into a degenerate Clifford Algebra $Cl_{p,q,r}(\mathbb{R})$.

These spaces, allows generalizing over approaches based on dual numbers (which cannot be modelled using $Cl_{p,q}$) and capturing patterns that emanate from the absence of higher-order interactions between real and complex parts of entity embeddings.
For the discovery of the extra parameter p,q and r we proposed four algorithms:

## Installation
Expand Down Expand Up @@ -32,7 +33,9 @@ wget https://files.dice-research.org/datasets/dice-embeddings/KGs.zip --no-check
</details>

# How to use this repo?
First install all the necessary packages: pip install -r requirements.txt
First install all the necessary packages using:
```bash
pip install -r requirements.txt ```
### Run the LES algorithm:
```bash
Expand Down
19 changes: 11 additions & 8 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_default_arguments(description=None):
parser.add_argument('--optim', type=str, default='Adam',
help='An optimizer',
choices=['Adam', 'AdamW', 'SGD',"NAdam", "Adagrad", "ASGD"])
parser.add_argument('--embedding_dim', type=int, default=32,
parser.add_argument('--embedding_dim', type=int, default=16,
help='Number of dimensions for an embedding vector. ')
parser.add_argument("--num_epochs", type=int, default=250, help='Number of epochs for training. ')
parser.add_argument('--batch_size', type=int, default=1024,
Expand Down Expand Up @@ -128,13 +128,16 @@ def get_default_arguments(description=None):
return parser.parse_args()
return parser.parse_args(description)

def main():
# def main():

args = get_default_arguments()
if args.continual_learning:
ContinuousExecute(args).continual_start()
else:
Execute(get_default_arguments()).start()
# args = get_default_arguments()
# if args.continual_learning:
# ContinuousExecute(args).continual_start()
# else:
# Execute(get_default_arguments()).start()

# if __name__ == '__main__':
# main()

if __name__ == '__main__':
main()
Execute(get_default_arguments()).start()

0 comments on commit e1f045a

Please sign in to comment.