Home

Awesome

MemN2N

Implementation of End-To-End Memory Networks with sklearn-like interface using Tensorflow. Tasks are from the bAbl dataset.

MemN2N picture

Get Started

git clone git@github.com:domluna/memn2n.git

mkdir ./memn2n/data/
cd ./memn2n/data/
wget http://www.thespermwhale.com/jaseweston/babi/tasks_1-20_v1-2.tar.gz
tar xzvf ./tasks_1-20_v1-2.tar.gz

cd ../
python single.py

Examples

Running a single bAbI task

Running a joint model on all bAbI tasks

These files are also a good example of usage.

Requirements

Single Task Results

For a task to pass it has to meet 95%+ testing accuracy. Measured on single tasks on the 1k data.

Pass: 1,4,12,15,20

Several other tasks have 80%+ testing accuracy.

Stochastic gradient descent optimizer was used with an annealed learning rate schedule as specified in Section 4.2 of End-To-End Memory Networks

The following params were used:

TaskTraining AccuracyValidation AccuracyTesting Accuracy
11.01.01.0
21.00.860.83
31.00.640.54
41.00.990.98
51.00.940.87
61.00.970.92
71.00.890.84
81.00.930.86
91.00.860.90
101.00.800.78
111.00.920.84
121.01.01.0
130.990.940.90
141.00.970.93
151.01.01.0
160.810.470.44
170.760.650.52
180.970.960.88
190.400.170.13
201.01.01.0

Joint Training Results

Pass: 1,6,9,10,12,13,15,20

Again stochastic gradient descent optimizer was used with an annealed learning rate schedule as specified in Section 4.2 of End-To-End Memory Networks

The following params were used:

TaskTraining AccuracyValidation AccuracyTesting Accuracy
11.00.990.999
21.00.840.849
30.990.720.715
40.960.860.851
51.00.920.865
61.00.970.964
70.960.870.851
80.990.890.898
90.990.960.96
101.00.960.928
111.00.980.93
121.00.980.982
130.990.980.976
141.00.810.877
151.01.00.983
160.640.450.44
170.770.640.547
180.850.710.586
190.240.070.104
201.01.00.996

Notes

Single task results are from 10 repeated trails of the single task model accross all 20 tasks with different random initializations. The performance of the model with the lowest validation accuracy for each task is shown in the table above.

Joint training results are from 10 repeated trails of the joint model accross all tasks. The performance of the single model whose validation accuracy passed the most tasks (>= 0.95) is shown in the table above (joint_scores_run2.csv). The scores from all 10 runs are located in the results/ directory.