11 | 
12 |
13 |
14 | ## Dependencies
15 | * Python 3.6
16 | * Tensorflow==1.14
17 | * numpy==1.16.4
18 | * PIL==7.1.1
19 |
20 | ## Usage
21 | ### Omniglot DataSet
22 | Download [images_background.zip](https://github.com/brendenlake/omniglot/blob/master/python/images_background.zip) (964 classes) and [images_evaluation.zip](https://github.com/brendenlake/omniglot/blob/master/python/images_evaluation.zip) (679 classes),
23 | and place them in the [./omniglot](omniglot) folder.
24 |
25 | ### Running
26 | `python run_mann.py`
27 | `python run_mann.py --mode test`
28 | `python run_mann.py --model LSTM`
29 | `python run_mann.py --model LSTM --mode test`
30 |
31 | ### Class MANNCell()
32 | ```python
33 | from mann.mann_cell import MANNCell
34 | cell = MANNCell(
35 | lstm_size = 200,
36 | memory_size = 128,
37 | memory_dim = 40,
38 | nb_reads = 4,
39 | gamma = 0.95
40 | )
41 | state = cell.zero_state(batch_size, tf.float32)
42 | output, state = tf.scan(lambda init, elem: cell(elem, init[1]), elems=tf.transpose(input, perm=[1, 0, 2]), initializer=(tf.zeros(shape=(batch_size, lstm_size+nb_reads*memory_dim)), state))
43 | output = tf.transpose(output, perm=[1, 0, 2])
44 | ```
45 |
46 |
47 |
48 | ## Performance
49 | Omniglot Classfication:
50 |
51 |  | 
52 | ---|---
53 |
54 |
55 | Test-set classfication accuracies on the Omniglot dataset, using one-hot encodings of labels and five classes presented per episode.
56 |
57 | | Model | 1