ˆemi = argmaxei∈E (cT

miei)

)

)

lossctx = cross_entropy(softmax(cmi, E), Iemi
mi, E), Iemi
lossent = cross_entropy(softmax(h(l)
2.4 Fact Memory
FILM contains a second fact memory, populated
by triples from the knowledge base K, as shown on
the right side of Figure 15. The fact memory shares
its on entity representations with the entity memory
embeddings in E, but each element of the fact mem-
ory corresponds to a symbolic substructure, namely
a key-value pair ((s, r),{o1, . . . , on}). The key
(s, r) is a (subject entity, relation) pair, and the cor-
responding value {o1, . . . , on} is the list of object
entities associated with s and r, i.e. (s, r, oi) ∈ K
for i = {1, . . . , n}. Conceptually, KB triples with
the same subject entity and relation are grouped
into a single element. We call the subject and rela-
tion pair aj = (s, r) ∈ A a head pair and the list
of objects bj = {o1, . . . , on} ∈ B a tail set6.

5In our experiments we use a single fact memory access
Adaptable and Interpretable Neural Memory Over Symbolic Knowledge