Code Monkey home page Code Monkey logo

dynamic-memory-networks-plus-pytorch's Introduction

Dynamic-memory-networks-plus-Pytorch

DMN+ implementation in Pytorch for question answering on the bAbI 10k dataset.

Contents

file description
babi_loader.py declaration of bAbI Pytorch Dataset class
babi_main.py contains DMN+ model and training code
fetch_data.sh shell script to fetch bAbI tasks (from DMNs in Theano)

Usage

Install Pytorch v0.1.12 and Python 3.6.x (for Literal String Interpolation)

Run the included shell script to fetch the data

chmod +x fetch_data.sh
./fetch_data.sh

Run the main python code

python babi_main.py

Benchmarks

Low accuracies compared to Xiong et al's are may due to different weight decay setting or the model's instability.

On some tasks, the accuracy was not stable across multiple runs. This was particularly problematic on QA3, QA17, and QA18. To solve this, we repeated training 10 times using random initializations and evaluated the model that achieved the lowest validation set loss.

You can find pretrained models here

Task ID This Repo Xiong et al
1 100% 100%
2 96.8% 99.7%
3 89.2% 98.9%
4 100% 100%
5 99.5% 99.5%
6 100% 100%
7 97.8% 97.6%
8 100% 100%
9 100% 100%
10 100% 100%
11 100% 100%
12 100% 100%
13 100% 100%
14 99% 99.8%
15 100% 100%
16 51.6% 54.7%
17 86.4% 95.8%
18 97.9% 97.9%
19 99.7% 100%
20 100% 100%

dynamic-memory-networks-plus-pytorch's People

Contributors

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

Watchers

 avatar  avatar

dynamic-memory-networks-plus-pytorch's Issues

pretrained model

Hi,
Thank you for sharing nice codes!!
It will be really helpful to me.

Could you explain how to use pretrained model to get an accuracy?
I am new to pytorch.

Test Accuracy in the log.txt

Thank you for your unselfish sharing and nice work.

I noticed that the test accuracy writed in log.txt is as

fp.write(f'[Run {run}, Task {task_id}, Epoch {epoch}] [Test] Accuracy : {total_acc: {5}.{4}}' + '\n')

But the total_acc is the valid accuracy while test_acc / cnt is the correct one.

problems with validation set on a similar project

Hi. I'm pretty much a newbie at neural networks. This is a question I asked on the yerevann blog site but I never got an answer. I'm using your code as something of a guide along with the yerevann code. I'm programming in Pytorch. (I also use part of the yerevann data loader. That code is properly attributed to them.) I'm trying to implement a similar DMN for the babi set. My code is here: https://github.com/radiodee1/awesome-chatbot . Here's a question I have.

I split the training and testing data into parts for training, testing, and validation. I use 1000 parts for training, 500 parts for testing and 500 parts for validation. I run into a problem. I can train successfully but when I go to the validation step I never get a score above 50% accuracy. My question to you is what part of the program would be responsible for this kind of behavior? In other words, can you tell me why I'm always getting 50% ?? Thanks for your time. I understand this blog is pretty old. I'm limiting my experiments to the first babi test. I thought I had an answer to this question and then it popped up again and I cannot get rid of it.

thanks again.

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.