From 9d6c08ab727a097803fcafcb90c4ee126e0ca659 Mon Sep 17 00:00:00 2001 From: Eren Golge Date: Tue, 24 Apr 2018 11:30:58 -0700 Subject: [PATCH] guided attn #4 --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index f637b91b..7c47c394 100644 --- a/train.py +++ b/train.py @@ -115,7 +115,7 @@ def train(model, criterion, data_loader, optimizer, epoch): M[n, t] = val e_x = np.exp(M - np.max(M)) M = e_x / e_x.sum(axis=0) # only difference - M = Variable(M) + M = Variable(torch.FloatTensor(M)) M = torch.stack([M]*32) # forward pass