Giter VIP home page Giter VIP logo

ggnn-for-babi-dataset.pytorch.1.0's Introduction

A PyTorch 1.0 Implementation of GGNN on bAbI

This is an Implementation of GGNN based on paper Gated Graph Sequence Neural Networks. I only focus on the experiments of GGNN on bAbI dataset. There is also another good pytorch implementation of GGNN by JamesChuanggg Link. However, it doesn't include task 18, 19 (the GraphLevel Output), and in original paper, it use 10 generated datasets to achieve average performance while JamesChuanggg only use one. This implementation is a complete version of GGNN. Wish it may help you.

Requirements

  • python=3.6
  • PyTorch=1.0 or 0.4 (0.3 is not tested)
  • Dataset is included in this project, you don't need to download. (following JamesChuanggg Link)

Train

Task 4:  python main.py --task_id 4 
Task 15: python main.py --task_id 15
Task 16: python main.py --task_id 16 --hidden_dim 20 --epoch 150 (Task 16 is easy to stuck in local optim, if so please try again)
Task 18: python main.py --task_id 18 --epoch 50
Task 19: python main.py --task_id 19 --epoch 50

Definition of arguments

--train_size (1~1000): the number of training instances we use, here we use 50 as default as original paper
--task_id (4,15,16,18,19): since original paper only test GGNN on these 5 tasks
--question_id (0~3): for task 4, there are four types of questions, for the rest task, just use defualt value 0
--data_id (0~10): if you set it as 0, it will train 10 different model on 10 different datasets and return average performance, if you set it as 1~10, just run the corresponding dataset
--hidden_dim: hidden size of feature vector
--n_steps: GGNN will be iteratively run n times
--epoch: number of epoch
--resume: if you want to resume from an existing model, please define the name of existing model on config.MODEL_PATH
--name: name of your model, which will be saved to ./model/yourname.pth

The rest parameters that we don't often change are defined in config.py

References

ggnn-for-babi-dataset.pytorch.1.0's People

Contributors

kaihuatang avatar

Watchers

 avatar  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.