https://github.com/magnusja/conve
Implementation of ConvE proposed by Dettmers et al. in Convolutional 2D Knowledge Graph Embeddings.
https://github.com/magnusja/conve
conve convolutional-neural-networks deep-learning knowledge-embedding knowledge-graph machine-learning network-embedding neural-network
Last synced: 10 months ago
JSON representation
Implementation of ConvE proposed by Dettmers et al. in Convolutional 2D Knowledge Graph Embeddings.
- Host: GitHub
- URL: https://github.com/magnusja/conve
- Owner: magnusja
- License: apache-2.0
- Created: 2017-07-13T05:53:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-24T15:04:33.000Z (almost 8 years ago)
- Last Synced: 2025-04-20T07:58:19.206Z (about 1 year ago)
- Topics: conve, convolutional-neural-networks, deep-learning, knowledge-embedding, knowledge-graph, machine-learning, network-embedding, neural-network
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 15
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# ConvE
Implementation of ConvE proposed by Dettmers et al. in [Convolutional 2D Knowledge Graph Embeddings](https://arxiv.org/abs/1707.01476). You can find the official repository with knowledge graph datasets [here](https://github.com/TimDettmers/ConvE).
Implementation uses [PyTorch](http://pytorch.org/).
## Usage
### Preprocessing
```
usage: preprocess.py [-h] {train,valid} ...
Preprocess knowledge graph csv train/valid (test) data.
positional arguments:
{train,valid} mode
train Preprocess a training set
valid Preprocess a valid or test set
optional arguments:
-h, --help show this help message and exit
```
#### Training set
```
python preprocess.py train ../train.tsv
```
#### Validation set
```
python preprocess.py valid ../train.pkl ../valid.tsv
```
### Training
```
python train.py ../train.pkl ../valid.pkl
```
```
usage: train.py [-h] [--name NAME] [--batch-size BATCH_SIZE] [--epochs EPOCHS]
[--label-smooth LABEL_SMOOTH]
train_path valid_path
Train ConvE with PyTorch.
positional arguments:
train_path Path to training .pkl produced by preprocess.py
valid_path Path to valid/test .pkl produced by preprocess.py
optional arguments:
-h, --help show this help message and exit
--name NAME name of the model, used to create a subfolder to save
checkpoints
--batch-size BATCH_SIZE
--epochs EPOCHS
--label-smooth LABEL_SMOOTH
```