You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defwrite(self, w, e, a):
"""write to memory (according to section 3.2)."""self.prev_mem=self.memoryself.memory=Variable(torch.Tensor(self.batch_size, self.N, self.M))
erase=torch.matmul(w.unsqueeze(-1), e.unsqueeze(1))
add=torch.matmul(w.unsqueeze(-1), a.unsqueeze(1))
self.memory=self.prev_mem* (1-erase) +add
In your writing method, I dont understand why u create a new Variable(torch.Tensor(self.batch_size, self.N, self.M)) and then assign the new value,
Why not write as following directly :
defwrite(self, w, e, a):
"""write to memory (according to section 3.2)."""erase=torch.matmul(w.unsqueeze(-1), e.unsqueeze(1))
add=torch.matmul(w.unsqueeze(-1), a.unsqueeze(1))
self.memory=self.memory* (1-erase) +add
The text was updated successfully, but these errors were encountered:
Hi, dear author:
In your writing method, I dont understand why u create a new
Variable(torch.Tensor(self.batch_size, self.N, self.M))
and then assign the new value,Why not write as following directly :
The text was updated successfully, but these errors were encountered: