Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/domluna/memn2n
End-To-End Memory Network using Tensorflow
https://github.com/domluna/memn2n
memory-networks nlp tensorflow
Last synced: 27 days ago
JSON representation
End-To-End Memory Network using Tensorflow
- Host: GitHub
- URL: https://github.com/domluna/memn2n
- Owner: domluna
- License: mit
- Created: 2015-11-30T18:16:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T16:46:57.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T23:35:36.330Z (2 months ago)
- Topics: memory-networks, nlp, tensorflow
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 342
- Watchers: 18
- Forks: 134
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-tensorflow - End-To-End Memory Networks - Implementation of [End-To-End Memory Networks](http://arxiv.org/abs/1503.08895) (Models/Projects)
- Awesome-TensorFlow-Chinese - End-To-End Memory Networks - Implementation of [End-To-End Memory Networks](http://arxiv.org/abs/1503.08895) (模型项目 / 微信群)
- awesome-tensorflow - End-To-End Memory Networks - Implementation of [End-To-End Memory Networks](http://arxiv.org/abs/1503.08895) (Models/Projects)
- fucking-awesome-tensorflow - End-To-End Memory Networks - Implementation of [End-To-End Memory Networks](http://arxiv.org/abs/1503.08895) (Models/Projects)
README
# MemN2N
Implementation of [End-To-End Memory Networks](http://arxiv.org/abs/1503.08895) with sklearn-like interface using Tensorflow. Tasks are from the [bAbl](http://arxiv.org/abs/1502.05698) dataset.
![MemN2N picture](https://www.dropbox.com/s/3rdwfxt80v45uqm/Screenshot%202015-11-19%2000.57.27.png?dl=1)
### Get Started
```
git clone [email protected]:domluna/memn2n.gitmkdir ./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.gzcd ../
python single.py
```### Examples
Running a [single bAbI task](./single.py)
Running a [joint model on all bAbI tasks](./joint.py)
These files are also a good example of usage.
### Requirements
* tensorflow 1.0
* scikit-learn 0.17.1
* six 1.10.0### 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](http://arxiv.org/abs/1503.08895)
The following params were used:
* epochs: 100
* hops: 3
* embedding_size: 20Task | Training Accuracy | Validation Accuracy | Testing Accuracy
------|---------------------|-----------------------|------------------
1 | 1.0 | 1.0 | 1.0
2 | 1.0 | 0.86 | 0.83
3 | 1.0 | 0.64 | 0.54
4 | 1.0 | 0.99 | 0.98
5 | 1.0 | 0.94 | 0.87
6 | 1.0 | 0.97 | 0.92
7 | 1.0 | 0.89 | 0.84
8 | 1.0 | 0.93 | 0.86
9 | 1.0 | 0.86 | 0.90
10 | 1.0 | 0.80 | 0.78
11 | 1.0 | 0.92 | 0.84
12 | 1.0 | 1.0 | 1.0
13 | 0.99 | 0.94 | 0.90
14 | 1.0 | 0.97 | 0.93
15 | 1.0 | 1.0 | 1.0
16 | 0.81 | 0.47 | 0.44
17 | 0.76 | 0.65 | 0.52
18 | 0.97 | 0.96 | 0.88
19 | 0.40 | 0.17 | 0.13
20 | 1.0 | 1.0 | 1.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](http://arxiv.org/abs/1503.08895)
The following params were used:
* epochs: 60
* hops: 3
* embedding_size: 40Task | Training Accuracy | Validation Accuracy | Testing Accuracy
------|-------------------|---------------------|-------------------
1 | 1.0 | 0.99 | 0.999
2 | 1.0 | 0.84 | 0.849
3 | 0.99 | 0.72 | 0.715
4 | 0.96 | 0.86 | 0.851
5 | 1.0 | 0.92 | 0.865
6 | 1.0 | 0.97 | 0.964
7 | 0.96 | 0.87 | 0.851
8 | 0.99 | 0.89 | 0.898
9 | 0.99 | 0.96 | 0.96
10 | 1.0 | 0.96 | 0.928
11 | 1.0 | 0.98 | 0.93
12 | 1.0 | 0.98 | 0.982
13 | 0.99 | 0.98 | 0.976
14 | 1.0 | 0.81 | 0.877
15 | 1.0 | 1.0 | 0.983
16 | 0.64 | 0.45 | 0.44
17 | 0.77 | 0.64 | 0.547
18 | 0.85 | 0.71 | 0.586
19 | 0.24 | 0.07 | 0.104
20 | 1.0 | 1.0 | 0.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.