Giter VIP home page Giter VIP logo

sans's Introduction

Structure Aware Negative Sampling in Knowledge Graphs

Introduction

This repository provides the PyTorch implementation of Structure Aware Negative Sampling (SANS) technique presented in Structure Aware Negative Sampling in Knowledge Graphs paper as well as several popular KGE models.

Execution

As an example, the following command trains and validates a TransE model on wn18rr dataset by using RW-SANS with 1000 random walks on 3-Hop neighborhood:

CUDA_VISIBLE_DEVICES=0 python -u codes/run.py --cuda \
    --do_train --do_valid \
    --data_path data/wn18rr \
    --model TransE \
    -n 256 -b 1024 -d 1000 \
    -g 24.0 -a 1.0 \
    -lr 0.0001 --max_steps 150000 \
    -save models/TransE_wn18rr_0 --test_batch_size 16 \
    -khop 3 -nrw 1000

To check all the available arguments, you can run python codes/run.py --help.

Reproducibility

To reproduce the results presented in the EMNLP 2020 paper Structure Aware Negative Sampling in Knowledge Graphs, you can use the commands provided in best_config.sh.

Infrustrucutre

All experiments were carried on a server with one NVIDIA V100 GPU, 10 CPU cores, and 46GB RAM.

Acknowledgments

Our implemention is based on the PyTorch implementation of RotatE model provided here. This research was enabled in part by support provided by Calcul Québec and Compute Canada.

sans's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.