import memory
import head
# import write_heads

from keras import backend as K

number_of_memory_locations = 6
memory_vector_size = 3

memory_t = memory.initial(number_of_memory_locations, memory_vector_size)

weight_t = K.random_binomial((number_of_memory_locations, 1), 0.2)

read_vector = head.reading(memory_t, weight_t)

print memory_t.shape
print weight_t.shape
print read_vector


@@ -1,25 +1,42 @@
-import memory
+from keras import backend as K
 %0Aimport 
 head
@@ -35,67 +35,71 @@
 ort 
+t
 hea
-d%0A# import write_heads%0A%0Afrom keras import backend as K%0A%0A
+no.tensor as T%0Aimport theano%0Aimport memory%0Aimport head%0A#%0A# 
 numb
@@ -125,16 +125,18 @@
 ons = 6%0A
+# 
 memory_v
@@ -150,17 +150,20 @@
 ize = 3%0A
-%0A
+#%0A# 
 memory_t
@@ -228,17 +228,20 @@
 r_size)%0A
-%0A
+#%0A# 
 weight_t
@@ -299,17 +299,20 @@
 ), 0.2)%0A
-%0A
+#%0A# 
 read_vec
@@ -350,17 +350,20 @@
 ight_t)%0A
-%0A
+#%0A# 
 print me
@@ -371,24 +371,26 @@
 ory_t.shape%0A
+# 
 print weight
@@ -398,16 +398,18 @@
 t.shape%0A
+# 
 print re
@@ -418,9 +418,164 @@
 _vector%0A
+#%0A%0A%0Adef logistic(x):%0A    s = 1 / (1 + K.exp(x))%0A    log = theano.function(%5Bx%5D, s)%0A    return log%0A    # return s%0A%0Ax = %5B%5B0, 1%5D, %5B-1, -2%5D%5D%0Aprint logistic(x)%0A%0A
 %0A

Update code of NTM based on Keras.