Skip to content

Commit

Permalink
fix u_begin to zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
ronghanghu committed May 19, 2018
1 parent 593a6d1 commit 1d18d71
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tasks/R2R/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,8 @@ def __init__(self, embedding_size, hidden_size, dropout_ratio,
self.feature_size = feature_size
self.hidden_size = hidden_size
# self.embedding = nn.Embedding(input_action_size, embedding_size)
u_std = np.sqrt(1. / embedding_size)
self.u_begin = nn.Parameter(torch.from_numpy(np.random.normal(
0, u_std, (1, embedding_size)).astype(np.float32))).cuda()
self.u_begin = try_cuda(Variable(
torch.zeros(embedding_size), requires_grad=False))
self.drop = nn.Dropout(p=dropout_ratio)
self.lstm = nn.LSTMCell(embedding_size+feature_size, hidden_size)
self.visual_attention_layer = VisualSoftDotAttention(
Expand Down

0 comments on commit 1d18d71

Please sign in to comment.