Giter Site home page Giter Site logo

plogicnet's Introduction

pLogicNet

This is an implementation of the model from the paper Probabilistic Logic Neural Networks for Reasoning.

Usage

In our repo, four benchmark datasets are provided, including FB15k, FB15k-237, WN18, WN18RR. Those datasets are available in the data folder. The folder kge provides the codes for knowledge graph embedding, and the folder mln gives an implementation of the Markov logic network, in which four rule patterns are considered, including the composition rule, symmetric rule, inverse rule and subrelation rule.

Since the MLN module is written in C++, we need to compile the MLN codes before running the program. To compile the codes, we can enter the mln folder and execute the following command:

g++ -O3 mln.cpp -o mln -lpthread

Afterwards, we can run pLogicNet by using the script run.py in the main folder.

During training, the program will create a saving folder in record to save the intermediate outputs and the results, and the folder is named as the time when the job is submitted. For each iteration, the program will create a subfolder inside the saving folder. In each subfolder, the result of pLogicNet on validation set, the result of pLogicNet on test set and the result of pLogicNet* on test set are saved into result_kge_valid.txt, result_kge.txt and result_kge_mln.txt respectively. Based on the validation results, we can then pick up the best model, and use it for evaluation or apply it to other knowledge graphs for link prediction.

Acknowledgement

The knowledge graph embedding codes in the kge folder are from the nice repo KnowledgeGraphEmbedding, where many knowledge graph embedding algorithms are implemented.

Citation

Please consider citing the following paper if you find our codes helpful. Thank you!

@inproceedings{qu2019probabilistic,
  title={Probabilistic Logic Neural Networks for Reasoning},
  author={Qu, Meng and Tang, Jian},
  booktitle={Advances in neural information processing systems},
  year={2019}
}

plogicnet's People

Contributors

mnqu avatar

Watchers

 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.