where \(h^{\prime }_t\)  is the candidate hidden state for the GRU's internal update at time step \(t\) . The attention gate \(g^i_t\)  is a function of the input \(x_t\)  and the memory and question vectors, encoding their similarities (details can be found in [1]}). The initial memory is initialized as \(m^0 = Q\) . The hidden state of an episode \(e^i\)  is then computed as \(e^i_t = \mathtt {AttGRU}^i(c_t, e_{t-1})\) , where \(c_t = [s_t; m^{i-1}]\)  is a candidate fact and \([\cdot ; \cdot ]\)  denotes concatenation. The new memory value is then simply set to the last hidden state of the episode, i.e. \(m^i = e^i_M\) . Finally, the output of the episodic memory module is the last output of a GRU that iterates over all memories \(m^i\) .
