Giter VIP home page Giter VIP logo

nlil's Introduction

Neural Logic Inductive Learning

This is the implementation of the Neural Logic Inductive Learning model (NLIL) proposed in the ICLR 2020 paper: Learn to Explain Efficiently via Neural Logic Inductive Learning. The Transformer implementation is based on this repo.

Requirements

  • python 3.6+
  • pytorch 1.1.0+
  • numpy
  • tqdm

Knowledge completion on WN18 and FB15K

You can run knowledge completion task on WN18 and FB15K with provided scripts

bash run_wn.sh
bash run_fb.sh

Object classification on Visual Genome

First, download the scene-graph dataset from the official site (click "Download Scene Graphs")

https://cs.stanford.edu/people/dorarad/gqa/download.html

Extract the files, and run the following script to generate the dataset

bash preprocess.sh path/to/the/sgraph/folder

Now you can run object classification with

bash run_gqa.sh

Reference

@inproceedings{
    yang2020learn,
    title={Learn to Explain Efficiently via Neural Logic Inductive Learning},
    author={Yuan Yang and Le Song},
    booktitle={International Conference on Learning Representations},
    year={2020},
    url={https://openreview.net/forum?id=SJlh8CEYDB}
}

nlil's People

Contributors

gblackout avatar gblackoutwas4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nlil's Issues

Questions about model implementation

Hi, I am very interested in your work.But I have some questions

The Operator search of Section 4 in the Paper is as follows

the EncoderLayer(nn.Module) take Q and V as the input .
image

However,the EncoderLayer(nn.Module) in your code dose not use Q as the input. The code just take the V as the input .

image

In addition, you use Q instead of q as input in DecoderLayer(nn.Module).

Is there a mistake in my understanding? Can you answer this doubt for me?

Issue running evensucc10 dataset

By simply changing the learning folder to the evensucc10 dataset through:

--data_root ../data/evensucc10

yields an error:

  File "<...>/model/SubLayers.py", line 45, in forward
    q = q.permute(2, 0, 1, 3).contiguous().view(-1, len_q, d_k)  # (n*b) x lq x dk
RuntimeError: cannot reshape tensor of 0 elements into shape [-1, 0, 32] because the unspecified dimension size -1 can be any value and is ambiguous

I believe it is caused by

mldel/Models.py: line 200~204: # TODO: debug ...

Can you help me take a look into this issue?

inference

Can you please provide a simple example of how to work with the trained model? As I understand it, once trained on a KB, it should generate FOL rules? Does it save them somewhere? Or we can get them interactively from the model?

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.