Knowledge Graph Autoencoder Training Environment, bridging PyG encoders and TorchKGE decoders.
Project description
Knowledge Graph Autoencoder Training Environment (KGATE)
KGATE is a knowledge graph embedding library bridging the encoders from Pytorch Geometric and the decoders from TorchKGE.
This tool relies heavily on the performances of TorchKGE and its numerous implemented modules for link prediction, negative sampling and model evaluation. The main goal here is to address the lack of encoders in the original library, who is unfortunately not maintained anymore.
Installation
To join in the development, clone this repository and install Poetry:
pip install poetry
Install the dependencies with:
poetry install
Usage
KGATE is meant to be a self-sufficient training environment for knowledge graph embedding that requires very little code to work but can easily be expanded or modified. Everything stems from the Architect class, which holds all the necessary attributes and methods to fully train and test a KGE model following the autoencoder architecture, as well as run inference.
from kgate import Architect
config_path = "/path/to/your/config.toml"
architect = Architect(config = config_path)
# Train the model using KG and hyperparameters specified in the configuration
architect.train()
# Test the trained model, using the best checkpoint
architect.test()
# Run KG completion task, the empty list is the element that will be predicted
known_heads = []
known_relations = []
known_tails = []
architect.infer(known_heads, known_relations, known_tails)
For a more detailed example and specific methods that are available in the package, see the upcoming readthedocs documentation.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kgate-0.1.10.tar.gz.
File metadata
- Download URL: kgate-0.1.10.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.10.7-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f943c871deedbba60eddb31cdf01bd5665ac48e62c71e0c9ede6ce61e92a5ff
|
|
| MD5 |
8e7081bb12a003cd12f3f550a9289fca
|
|
| BLAKE2b-256 |
b0847b75d57e4b184cff0acff4875744ab84c0a9d66c0b877c1df14307c27061
|
File details
Details for the file kgate-0.1.10-py3-none-any.whl.
File metadata
- Download URL: kgate-0.1.10-py3-none-any.whl
- Upload date:
- Size: 40.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.10.7-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cec6922b785244701613342dac87c98422308b462e22e883ddd36ffccfd96a2
|
|
| MD5 |
904fc67e76f222c265b890231f023484
|
|
| BLAKE2b-256 |
4d541c551ba6d22a834a749831b5fad96131f26c725bda4cb3e9904f7b5e5af0
|