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
Hi! Thanks for your share code.
I'm studying with your paper with code.
I have a question about comments in your code.
EncoderMemNN in Mem2Seq.py
def forward(self, story):
story = story.transpose(0,1)
story_size = story.size() # b * m * 3
if self.unk_mask:
if(self.training):
ones = np.ones((story_size[0],story_size[1],story_size[2]))
rand_mask = np.random.binomial([np.ones((story_size[0],story_size[1]))],1-self.dropout)[0]
ones[:,:,0] = ones[:,:,0] * rand_mask
a = Variable(torch.Tensor(ones))
if USE_CUDA: a = a.cuda()
story = story*a.long()
u = [self.get_state(story.size(0))]
for hop in range(self.max_hops):
embed_A = self.C[hop](story.contiguous().view(story.size(0), -1).long()) # b * (m * s) * e
embed_A = embed_A.view(story_size+(embed_A.size(-1),)) # b * m * s * e
m_A = torch.sum(embed_A, 2).squeeze(2) # b * m * e
What does b, m, s, e, 3 mean?
Thank you!
The text was updated successfully, but these errors were encountered:
Hi! Thanks for your share code.
I'm studying with your paper with code.
I have a question about comments in your code.
EncoderMemNN in Mem2Seq.py
What does
b, m, s, e, 3
mean?Thank you!
The text was updated successfully, but these errors were encountered: